Skip to content

🏃 Run tests with race detector enabled #1012

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

Merged
merged 1 commit into from
Jul 13, 2020

Conversation

alvaroaleman
Copy link
Member

@alvaroaleman alvaroaleman commented Jun 21, 2020

Changes the test script to run with --race and fixes the three five races found (all of which are in test code)

@k8s-ci-robot k8s-ci-robot added the cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. label Jun 21, 2020
@k8s-ci-robot k8s-ci-robot added the size/S Denotes a PR that changes 10-29 lines, ignoring generated files. label Jun 21, 2020
@alvaroaleman alvaroaleman changed the title 🏃 Run tests with race detector enabled 🏃 Run tests with race detector enabled Jun 21, 2020
@alvaroaleman
Copy link
Member Author

/retest

@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 Jun 21, 2020
@@ -845,11 +850,13 @@ var _ = Describe("manger.Manager", func() {
m, err := New(cfg, Options{})
Expect(err).NotTo(HaveOccurred())
startGoruntime := rt.NumGoroutine()
_ = pprof.Lookup("goroutine").WriteTo(os.Stdout, 1)
Copy link
Member Author

Choose a reason for hiding this comment

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

The test here is apparently flaky with -race set. I am not sure if we can fix this, but having the dump here will at least give some clues.

I am unfortunately not able to repro the issue on my computer, that's why I left this here.

@alvaroaleman
Copy link
Member Author

/assign @vincepri

@vincepri
Copy link
Member

/test pull-controller-runtime-test-master

@alvaroaleman
Copy link
Member Author

Okay, that failure was presumably cpu starvation:

"timeout waiting for process kube-apiserver to start

Generally running the tests with -race means they need much more cpu so we might have to bump the requests of the job (But I think using the race detector provides a lot of value)
/retest

@vincepri
Copy link
Member

We could limit the amount of parallel tests with -p

@alvaroaleman
Copy link
Member Author

We could limit the amount of parallel tests with -p

Do you know how that interacts with ginkgo?

@vincepri
Copy link
Member

Ah, forgot about we were using ginkgo — I'll need to look into that, we can set GINKGO_NODES, which IIRC defaults to 1

@alvaroaleman
Copy link
Member Author

@vincepri wdyt about merging this? If we end up getting flakes we could for example use build flags to run a subset of tests without race detector

Copy link
Member

@vincepri vincepri left a comment

Choose a reason for hiding this comment

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

/approve
/lgtm

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

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: alvaroaleman, vincepri

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 /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@k8s-ci-robot k8s-ci-robot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Jul 13, 2020
@k8s-ci-robot k8s-ci-robot merged commit d60c21c into kubernetes-sigs:master Jul 13, 2020
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. 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/M Denotes a PR that changes 30-99 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants