-
Notifications
You must be signed in to change notification settings - Fork 4k
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
Fix race condition in scale down test #5227
Conversation
/assign @x13n |
Can you explain what was the race condition and how this PR fixes it? |
Tests run in parallel and use the same node groups, however the tests are use different set up. I suppose the race condition happened when we set cloud provider to the node group:
|
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
/approve
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: mwielgus, yaroslava-serdiuk 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 |
These tests don't run in parallel, the suite doesn't specify |
The race condition seems to be in |
With this PR merged (and the actual race condition fixed) we probably could add |
@x13n , yes, you are right that t.Parallel() is not added, however we can add after this change. I had the conclusion that they run in parallel because of race condition and I will explain why I think so.
I don't agree with you. Setting TestCloudProvider is happening at the beginning of the loop and the call of actuator.StartDeletion which invokes NodeDeleteBatcher is happening later in the loop, so this two calls are not happening simultaneously if they were called from one test. My understanding of the failure is following. This indeed may happen for test case with failed node deletion, for example for "Node deletion failed for one group two times" case.
may complete the execution and so the test case is completed, however if NodeDeletionBathcer execute only successful deletion and had 1 or 2 more calls to execute failed deletion the go routine from Batcher will continue to execution. So at this moment we will have two parallel execution of the test scenarios. So, I think the fix is actually fixing the race condition. If you see something wrong in my explanation or you disagree with me I will be happy to discuss. |
Thanks for the detailed explanation! Yup, this makes sense to me, we shouldn't be seeing this error anymore. |
Fix race condition in scale down test
Which component this PR applies to?
cluster-autoscaler
What this PR does / why we need it:
Fix race condition in unit test