-
Notifications
You must be signed in to change notification settings - Fork 1.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Accept CloudEvents in any order for CE reconcile test #3292
Conversation
} | ||
case <-timer.C: | ||
if len(expected) != 0 { | ||
return fmt.Errorf("timed out waiting for %d more events", len(expected)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
maybe include the remaining expected events too
fmt.Errorf("timed out waiting for %d more events: %#v", len(expected), expected)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good idea; done!
/lgtm |
Prior to this commit the test cloud events received during reconcile were required to be emitted in a strict order. We've been seeing some flakes in our unit tests related to this and in #2992 we posited that this might be happening because the cloud events controller emits each event in a separate go routine. We added some extra logging to try and catch the details of the flakes and it does appear that the events are being sent out-of-order. This commit adds a new helper func that allows the expected cloudevents to appear in any order while still failing the test if an unexpected event (or not enough events) are received.
/test pull-tekton-pipeline-integration-tests |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
/lgtm
/cc @afrittoli
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for this!
I wonder if we should do the same thing in the pipeline run controller tests, but in any case this PR looks.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
/approve
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: afrittoli The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
/kind flake /retest |
/remove-kind flake |
/kind flake |
Changes
Fixes #2992
Prior to this commit test cloud events received during reconcile were
required to be emitted in a strict order. We've been seeing some flakes in
our unit tests related to this and in
#2992 we posited that this might
be happening because the cloud events controller emits each event in a
separate go routine. We added some extra logging to try and catch the
details of the flakes and it does appear that the events are being sent
out-of-order.
This commit adds a new helper func that allows the expected cloudevents
to appear in any order while still failing the test if an unexpected event
(or not enough events) are received.
Submitter Checklist
These are the criteria that every PR should meet, please check them off as you
review them:
Release Notes