-
Notifications
You must be signed in to change notification settings - Fork 111
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
[DATA-566] Fix Flaky Test in DetectionSource #1512
Conversation
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.
Hi okay so the fix here was to add another case to NextResult that times out after 2 seconds and makes the return nil. I changed the test to include a timer that checks to make sure that behavior is what's expected (time out after 2 seconds).
I ran this 5000 times in a canon-shell-amd64 and it passed (and before the change it broke after ~1000 attempts)
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.
Just one question for the added for-loop, otherwise looking good
|
||
for res == nil { | ||
res, err = s.NextResult(ctx) | ||
if err != nil { | ||
return nil, nil, err | ||
} | ||
} | ||
|
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.
[q] Do you still need this for loop? Is NextResult ever going to produce a nil result now (and not an error)?
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.
Naw I guess we don't... removing now. Gonna run the test a few thousand times again but you're right.
|
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.
If the flakiness doesn't come back after a few thousand test runs, then this LGTM
No description provided.