-
-
Notifications
You must be signed in to change notification settings - Fork 5.2k
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
Do not Errorf during file watcher verification test loop. #3938
Do not Errorf during file watcher verification test loop. #3938
Conversation
@timoreimann Can you rebase on 1.7? Better tests in stable is a good thing ;) |
946ec7e
to
485aeed
Compare
@dtomcej done! |
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
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
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
The loop in TestProvideWithWatch is meant to be executed multiple times until either all configuration elements are found or the timeout expires. By calling assert.*, however, an assertion failure in a non-terminal loop run will cause t.Error to be invoked, thereby marking the whole test as failed even though subsequent loop runs could still yield a positive test result overall. We change the logic to t.Error only if the timeout hits (that is, we fail to collect the desired configuration updates in time).
485aeed
to
b5966e0
Compare
What does this PR do?
Change the logic in
file_test.go
'sTestProvideWithWatch
verification loop tot.Error
/t.Fail
only if the timeout hits (that is, we fail to collect the desired configuration updates in time).Motivation
The loop in
TestProvideWithWatch
is meant to be executed multiple times until either all configuration elements are found or the timeout expires. By callingassert.*
(such asassert.Len
), however, an assertion failure in a non-terminal loop run will causet.Error
to be invoked, thereby marking the whole test as failed even though subsequent loop runs could still yield a positive test result overall.Additional Notes
This test has failed repeatedly (albeit not consistently) in our (HolidayCheck's) local CI. I couldn't exactly pinpoint the reason, but I suspect different concurrency behavior and/or CI machine specs. Still, the logic as it is implemented now seems incorrect for the reasons I outlined above (
t.Error
should only be called on terminal test errors), and thus the implementation change should be an improvement IMHO.