-
Notifications
You must be signed in to change notification settings - Fork 55
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
servstate: remove on-check-failure test races #272
Conversation
This patch improves the following tests, all related to checker functionality in servstate observed when running under stress: TestOnCheckFailureRestartWhileRunning TestOnCheckFailureRestartDuringBackoff TestOnCheckFailureIgnore TestOnCheckFailureShutdown Since we are unit testing servstate, and not checkstate, this patch adds code to more effectively control (mock) when the check failure actions are delivered during the test. This removes the requirement for tests to rely on finely tuned delays to check various service life-cycle states. The following changes are made: - Round some of the delays to multiples of 100ms to highlight the fact these values are less important now. Delays intended to present infinite are replaced with 10s to ensure severe failures are observed if the test does not work as intended. - Remove iteration code to wait for a checker action, and replace with channel sync code. - Add some additional function comments to explain what the tests aim to confirm.
671d52b
to
4cd9ab4
Compare
Thanks for this! Definitely a nice incremental improvement. I updated the PR to fix the nits I mentioned so I can merge right away. |
@flotter synchronising on a channel seems like a good idea. Nonetheless, I am still observing intermittent failures in the following tests:
|
Sorry about this Jordan. I feel embarrassed, but will fix that asap. |
No need to be embarrassed, you're doing more than the rest of us ;) |
This patch improves the following tests, all related to checker functionality in servstate observed when running under stress:
TestOnCheckFailureRestartWhileRunning
TestOnCheckFailureRestartDuringBackoff
TestOnCheckFailureIgnore
TestOnCheckFailureShutdown
Since we are unit testing servstate, and not checkstate, this patch adds code to more effectively control (mock) when the check failure actions are delivered during the test. This removes the requirement for tests to rely on finely tuned delays to check various service life-cycle states.
The following changes are made:
Round some of the delays to multiples of 100ms to highlight the fact these values are less important now. Delays intended to present infinite are replaced with 10s to ensure severe failures are observed if the test does not work as intended.
Remove iteration code to wait for a checker action, and replace with channel sync code.
Add some additional function comments to explain what the tests aim to confirm.