-
Notifications
You must be signed in to change notification settings - Fork 1.9k
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
Use synchronization classes instead of Thread.sleep in test cases #2626
Use synchronization classes instead of Thread.sleep in test cases #2626
Conversation
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: tmrpavan The full list of commands accepted by this bot can be found here.
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
Welcome @tmrpavan! |
@brendandburns Can you review my PR |
In this context, I'm not sure that sleep is a problem. We need to wait for a period of time, but we expect to be interrupted. Adding the You could, in theory, make this test less flaky by blocking the thread until just before shutdown is called, and then waiting for a period of time to get interrupted by shutdown, but I don't think it's worth it. |
(oh and many thanks for taking on these type of PRs, they're generally useful and hard to get contributions, so thanks! it's just that this one may not be quite as useful as others) |
@brendandburns Thanks for your comments. I will work on this |
/retest |
@tmrpavan: Cannot trigger testing until a trusted user reviews the PR and leaves an In response to this:
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. |
Can anyone review this PR |
@brendandburns Can you please review this PR |
I don't think that this change is really any different than the code that is already there. I think in this case, Thread.sleep(...) is actually the right thing to do in this test. Let me know if I'm missing something. Thanks! |
Use synchronization classes instead of Thread.sleep in test cases
[Umbrella Issue] Many tests use Thread.sleep instead of synchronization primitives #1223