-
Notifications
You must be signed in to change notification settings - Fork 88
fix race in unit test and add some simple tests for utils #732
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
Conversation
Without this fix, running `go test -race -count 10` causes this failure: /var/folders/py/rwp4m4k977l9stj_f2kqrmxw000_5c/T/go-build3764188957/b001/csi-common.test flag redefined: log_dir --- FAIL: TestLogGRPC (0.00s) panic: /var/folders/py/rwp4m4k977l9stj_f2kqrmxw000_5c/T/go-build3764188957/b001/csi-common.test flag redefined: log_dir [recovered] panic: /var/folders/py/rwp4m4k977l9stj_f2kqrmxw000_5c/T/go-build3764188957/b001/csi-common.test flag redefined: log_dir goroutine 70 [running]: testing.tRunner.func1.2({0x17a37e0, 0xc0000b4180}) /usr/local/Cellar/go/1.18.5/libexec/src/testing/testing.go:1389 +0x366 testing.tRunner.func1() /usr/local/Cellar/go/1.18.5/libexec/src/testing/testing.go:1392 +0x5d2 panic({0x17a37e0, 0xc0000b4180}) /usr/local/Cellar/go/1.18.5/libexec/src/runtime/panic.go:844 +0x258 flag.(*FlagSet).Var(0xc00020c120, {0x19668c0, 0x1d00f90}, {0x186cfd4, 0x7}, {0x188d879, 0x52}) /usr/local/Cellar/go/1.18.5/libexec/src/flag/flag.go:879 +0x3a5 flag.(*FlagSet).StringVar(...) /usr/local/Cellar/go/1.18.5/libexec/src/flag/flag.go:762 k8s.io/klog/v2.InitFlags(0x0) /Users/avoltz/src/blob-csi-driver/vendor/k8s.io/klog/v2/klog.go:424 +0xee sigs.k8s.io/blob-csi-driver/pkg/csi-common.TestLogGRPC(0xc0000829c0) /Users/avoltz/src/blob-csi-driver/pkg/csi-common/utils_test.go:87 +0x45 testing.tRunner(0xc0000829c0, 0x18ae070) /usr/local/Cellar/go/1.18.5/libexec/src/testing/testing.go:1439 +0x214 created by testing.(*T).Run /usr/local/Cellar/go/1.18.5/libexec/src/testing/testing.go:1486 +0x725 FAIL sigs.k8s.io/blob-csi-driver/pkg/csi-common 4.298s FAIL
Hi @avoltz. Thanks for your PR. I'm waiting for a kubernetes-sigs member to verify that this patch is reasonable to test. If it is, they should reply with Once the patch is verified, the new status will be reflected by the I understand the commands that are listed here. 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. |
/ok-to-test |
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: andyzhangx, avoltz 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 |
What type of PR is this?
/kind test
What this PR does / why we need it:
Add some coverage to
pkg/util
tests.Fix a race in csi-common test, described in commit text:
Which issue(s) this PR fixes:
Fixes #
Requirements:
Special notes for your reviewer:
Release note: