Skip to content
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

🌱 Enable race detector for main module unit tests #11207

Merged

Conversation

sbueringer
Copy link
Member

@sbueringer sbueringer commented Sep 19, 2024

Signed-off-by: Stefan Büringer buringerst@vmware.com

What this PR does / why we need it:
Took the part for the unit tests of the main module from #10899.
I want to get the race detector for this part of our code base ASAP.

This PR:

  • enables the race detector for make test & make junit-test
  • make junit-test uses -json, because of that I had to make sure a proper logger is used in envtest unit tests, otherwise we hit a race condition when writing/reading os.Stderr
  • Fuzz tests time out after 10m when run with the race detector, because of that all test files with fuzz tests have been flagged with go build !race. Additional test executions have been added to make test and make test-junit to ensure the tests in these files are still executed (the !race tag means that these files are entirely ignored when running tests with -race)
  • The race detector slows down the test job. It now takes around 18m instead of 10m. But I think it's worth it. Also we usually have to wait for the e2e-blocking test anyway and that one takes ~17m.

Which issue(s) this PR fixes (optional, in fixes #<issue number>(, fixes #<issue_number>, ...) format, will close the issue(s) when PR gets merged):
Fixes #

@k8s-ci-robot k8s-ci-robot added the cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. label Sep 19, 2024
@k8s-ci-robot k8s-ci-robot added do-not-merge/needs-area PR is missing an area label size/S Denotes a PR that changes 10-29 lines, ignoring generated files. labels Sep 19, 2024
@sbueringer sbueringer added the area/testing Issues or PRs related to testing label Sep 19, 2024
@k8s-ci-robot k8s-ci-robot removed the do-not-merge/needs-area PR is missing an area label label Sep 19, 2024
@sbueringer
Copy link
Member Author

/hold

Just testing at the moment

@k8s-ci-robot k8s-ci-robot added the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Sep 19, 2024
@k8s-ci-robot k8s-ci-robot added size/M Denotes a PR that changes 30-99 lines, ignoring generated files. and removed size/S Denotes a PR that changes 10-29 lines, ignoring generated files. labels Sep 19, 2024
@sbueringer sbueringer changed the title 🌱 Enable race detector for main module unit tests (option 2) 🌱 Enable race detector for main module unit tests Sep 19, 2024
@sbueringer sbueringer added the tide/merge-method-squash Denotes a PR that should be squashed by tide when it merges. label Sep 19, 2024
@k8s-ci-robot k8s-ci-robot added size/L Denotes a PR that changes 100-499 lines, ignoring generated files. and removed size/M Denotes a PR that changes 30-99 lines, ignoring generated files. labels Sep 20, 2024
@sbueringer sbueringer force-pushed the pr-enable-race-detector-opt2 branch 3 times, most recently from d3abb54 to c32af73 Compare September 20, 2024 09:39
@sbueringer
Copy link
Member Author

/test pull-cluster-api-test-main

Copy link
Member

@fabriziopandini fabriziopandini left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

overall sgmt, just few nits
ping me when it is ready for a final pass

Signed-off-by: Stefan Büringer buringerst@vmware.com
@sbueringer
Copy link
Member Author

@fabriziopandini Thx, fixed!

/hold cancel

@k8s-ci-robot k8s-ci-robot removed the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Sep 20, 2024
@sbueringer
Copy link
Member Author

/test pull-cluster-api-e2e-main

@sbueringer
Copy link
Member Author

/assign @fabriziopandini @chrischdi

Copy link
Member

@chrischdi chrischdi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

/approve

@k8s-ci-robot k8s-ci-robot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Sep 20, 2024
@sbueringer
Copy link
Member Author

Checked, the usual MP flake ..

/override pull-cluster-api-e2e-main

@k8s-ci-robot
Copy link
Contributor

@sbueringer: Overrode contexts on behalf of sbueringer: pull-cluster-api-e2e-main

In response to this:

Checked, the usual MP flake ..

/override pull-cluster-api-e2e-main

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-sigs/prow repository.

@fabriziopandini
Copy link
Member

Nice
/lgtm
/approve

@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Sep 20, 2024
@k8s-ci-robot
Copy link
Contributor

LGTM label has been added.

Git tree hash: c0fb8f027d1adf1db4f5223c14ffe4febb97f45e

@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: chrischdi, fabriziopandini

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:
  • OWNERS [chrischdi,fabriziopandini]

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@k8s-ci-robot k8s-ci-robot merged commit 483276e into kubernetes-sigs:main Sep 20, 2024
19 checks passed
@k8s-ci-robot k8s-ci-robot added this to the v1.9 milestone Sep 20, 2024
@sbueringer
Copy link
Member Author

@kubernetes-sigs/cluster-api-release-team I ran this a few times, and I think I fixed all the race conditions we had. But please let me know if the periodic test job gets flaky with issues reported by the race detector. Happy to take a look / help to fix them! :)

@sbueringer sbueringer deleted the pr-enable-race-detector-opt2 branch September 20, 2024 17:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. area/testing Issues or PRs related to testing cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. lgtm "Looks good to me", indicates that a PR is ready to be merged. size/L Denotes a PR that changes 100-499 lines, ignoring generated files. tide/merge-method-squash Denotes a PR that should be squashed by tide when it merges.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants