-
Notifications
You must be signed in to change notification settings - Fork 297
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 ports read/write races in neg tests #1837
Fix ports read/write races in neg tests #1837
Conversation
Skipping CI for Draft Pull Request. |
@panslava: GitHub didn't allow me to request PR reviews from the following users: code-elinka. Note that only kubernetes members and repo collaborators can review this PR, and authors cannot review their own PRs. 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. |
deb297f
to
c6d2645
Compare
why not removing |
Do you think it is better? I feel like running tests in parallel can be good to find some weird errors (like these global variables, but not in real code), that we would never found if we ran everything single threaded |
in this case is a design choice , if you have a global variable to share in multiple test is a conscious decision, what is important though is to run with |
Tbh this tests were written not by me, but this global variable is actually not intended to be shared between tests (in the way that there is no shared logic based on this variable), as I understand, this is just some useful “const” |
And are the test modifying the variable? |
They do modify, but only for their own usage, like if they understand default const is not enough, they will append to it something extra ingress-gce/pkg/neg/controller_test.go Line 1771 in c6d2645
|
Oh, that is wrong thenz, it will pollute all the other tests |
So that’s what I am trying to fix in this PR, at first, I am taking a copy of this global ports, and then modify only copy |
What do you think about using a function instead?
|
c6d2645
to
19c72fe
Compare
thanks! good suggestion! changed |
/lgtm Thanks |
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: aojea, panslava 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 |
why don't you send a PR enabling the this way is easier to review and to fix |
@aojea the problem is, there are other tests that are failing race detector, so I can not enable it yet... and other tests are harder to fix (at least not as obvious) |
or you suggesting something else? Maybe I didn't understand completely the suggestion |
In general, I want to make all unit tests pass with -race, this is 1 step towards
Current approach with
ports
variable in neg tests has race, cause we use global variable, and we modify it from different tests/assign swetharepakula
/assign cezarygerard
/cc code-elinka
/cc aojea