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

test: add nodeserver.go unit test #1458

Merged
merged 2 commits into from
Aug 11, 2022

Conversation

umagnus
Copy link
Contributor

@umagnus umagnus commented Aug 10, 2022

What type of PR is this?

/kind test

What this PR does / why we need it:

add nodeserver.go unit test
fix TestLogGRPC ut failure

Which issue(s) this PR fixes:

Fixes #1424

Requirements:

Special notes for your reviewer:

this PR tries to fix the following issue:

==================
WARNING: DATA RACE
Write at 0x000001d620e0 by goroutine 25:
  flag.newBoolValue()
      /Users/runner/hostedtoolcache/go/1.19.0/x64/src/flag/flag.go:128 +0x208
  flag.(*FlagSet).BoolVar()
      /Users/runner/hostedtoolcache/go/1.19.0/x64/src/flag/flag.go:715 +0x214
  k8s.io/klog/v2.InitFlags()
      /Users/runner/work/azuredisk-csi-driver/azuredisk-csi-driver/vendor/k8s.io/klog/v2/klog.go:429 +0x1e6
  sigs.k8s.io/azuredisk-csi-driver/pkg/csi-common.TestLogGRPC()
      /Users/runner/work/azuredisk-csi-driver/azuredisk-csi-driver/pkg/csi-common/utils_test.go:87 +0x44
  testing.tRunner()
      /Users/runner/hostedtoolcache/go/1.19.0/x64/src/testing/testing.go:[1446](https://github.com/kubernetes-sigs/azuredisk-csi-driver/runs/7762127363?check_suite_focus=true#step:5:1447) +0x216
  testing.(*T).Run.func1()
      /Users/runner/hostedtoolcache/go/1.19.0/x64/src/testing/testing.go:1493 +0x47

Previous read at 0x000001d620e0 by goroutine 16:
  k8s.io/klog/v2.(*loggingT).output()
      /Users/runner/work/azuredisk-csi-driver/azuredisk-csi-driver/vendor/k8s.io/klog/v2/klog.go:879 +0x375
  k8s.io/klog/v2.(*loggingT).printfDepth()
      /Users/runner/work/azuredisk-csi-driver/azuredisk-csi-driver/vendor/k8s.io/klog/v2/klog.go:737 +0x2f7
  k8s.io/klog/v2.(*loggingT).printf()
      /Users/runner/work/azuredisk-csi-driver/azuredisk-csi-driver/vendor/k8s.io/klog/v2/klog.go:719 +0x98b
  k8s.io/klog/v2.Infof()
      /Users/runner/work/azuredisk-csi-driver/azuredisk-csi-driver/vendor/k8s.io/klog/v2/klog.go:[1465](https://github.com/kubernetes-sigs/azuredisk-csi-driver/runs/7762127363?check_suite_focus=true#step:5:1466) +0x910
  sigs.k8s.io/azuredisk-csi-driver/pkg/csi-common.(*nonBlockingGRPCServer).serve()
      /Users/runner/work/azuredisk-csi-driver/azuredisk-csi-driver/pkg/csi-common/server.go:117 +0x85a
  sigs.k8s.io/azuredisk-csi-driver/pkg/csi-common.(*nonBlockingGRPCServer).Start.func1()
      /Users/runner/work/azuredisk-csi-driver/azuredisk-csi-driver/pkg/csi-common/server.go:56 +0xec

Goroutine 25 (running) created at:
  testing.(*T).Run()
      /Users/runner/hostedtoolcache/go/1.19.0/x64/src/testing/testing.go:[1493](https://github.com/kubernetes-sigs/azuredisk-csi-driver/runs/7762127363?check_suite_focus=true#step:5:1494) +0x75d
  testing.runTests.func1()
      /Users/runner/hostedtoolcache/go/1.19.0/x64/src/testing/testing.go:1846 +0x99
  testing.tRunner()
      /Users/runner/hostedtoolcache/go/1.19.0/x64/src/testing/testing.go:1446 +0x216
  testing.runTests()
      /Users/runner/hostedtoolcache/go/1.19.0/x64/src/testing/testing.go:1844 +0x7ec
  testing.(*M).Run()
      /Users/runner/hostedtoolcache/go/1.19.0/x64/src/testing/testing.go:1726 +0xa84
  main.main()
      _testmain.go:79 +0x2e9

Goroutine 16 (finished) created at:
  sigs.k8s.io/azuredisk-csi-driver/pkg/csi-common.(*nonBlockingGRPCServer).Start()
      /Users/runner/work/azuredisk-csi-driver/azuredisk-csi-driver/pkg/csi-common/server.go:56 +0x206
  sigs.k8s.io/azuredisk-csi-driver/pkg/csi-common.TestStart()
      /Users/runner/work/azuredisk-csi-driver/azuredisk-csi-driver/pkg/csi-common/server_test.go:37 +0xae
  testing.tRunner()
      /Users/runner/hostedtoolcache/go/1.19.0/x64/src/testing/testing.go:1446 +0x216
  testing.(*T).Run.func1()
      /Users/runner/hostedtoolcache/go/1.19.0/x64/src/testing/testing.go:1493 +0x47
==================
==================
WARNING: DATA RACE
Write at 0x000001d6219a by goroutine 25:
  flag.newBoolValue()
      /Users/runner/hostedtoolcache/go/1.19.0/x64/src/flag/flag.go:128 +0x2fb
  flag.(*FlagSet).BoolVar()
      /Users/runner/hostedtoolcache/go/1.19.0/x64/src/flag/flag.go:715 +0x307
  k8s.io/klog/v2.InitFlags()
      /Users/runner/work/azuredisk-csi-driver/azuredisk-csi-driver/vendor/k8s.io/klog/v2/klog.go:432 +0x2d6
  sigs.k8s.io/azuredisk-csi-driver/pkg/csi-common.TestLogGRPC()
      /Users/runner/work/azuredisk-csi-driver/azuredisk-csi-driver/pkg/csi-common/utils_test.go:87 +0x44
  testing.tRunner()
      /Users/runner/hostedtoolcache/go/1.19.0/x64/src/testing/testing.go:1446 +0x216
  testing.(*T).Run.func1()
      /Users/runner/hostedtoolcache/go/1.19.0/x64/src/testing/testing.go:1493 +0x47

Previous read at 0x000001d6219a by goroutine 16:
  k8s.io/klog/v2.(*loggingT).header()
      /Users/runner/work/azuredisk-csi-driver/azuredisk-csi-driver/vendor/k8s.io/klog/v2/klog.go:656 +0xc8
  k8s.io/klog/v2.(*loggingT).printfDepth()
      /Users/runner/work/azuredisk-csi-driver/azuredisk-csi-driver/vendor/k8s.io/klog/v2/klog.go:723 +0x87
  k8s.io/klog/v2.(*loggingT).printf()
      /Users/runner/work/azuredisk-csi-driver/azuredisk-csi-driver/vendor/k8s.io/klog/v2/klog.go:719 +0x98b
  k8s.io/klog/v2.Infof()
      /Users/runner/work/azuredisk-csi-driver/azuredisk-csi-driver/vendor/k8s.io/klog/v2/klog.go:1465 +0x910
  sigs.k8s.io/azuredisk-csi-driver/pkg/csi-common.(*nonBlockingGRPCServer).serve()
      /Users/runner/work/azuredisk-csi-driver/azuredisk-csi-driver/pkg/csi-common/server.go:117 +0x85a
  sigs.k8s.io/azuredisk-csi-driver/pkg/csi-common.(*nonBlockingGRPCServer).Start.func1()
      /Users/runner/work/azuredisk-csi-driver/azuredisk-csi-driver/pkg/csi-common/server.go:56 +0xec

Goroutine 25 (running) created at:
  testing.(*T).Run()
      /Users/runner/hostedtoolcache/go/1.19.0/x64/src/testing/testing.go:1493 +0x75d
  testing.runTests.func1()
      /Users/runner/hostedtoolcache/go/1.19.0/x64/src/testing/testing.go:1846 +0x99
  testing.tRunner()
      /Users/runner/hostedtoolcache/go/1.19.0/x64/src/testing/testing.go:1446 +0x216
  testing.runTests()
      /Users/runner/hostedtoolcache/go/1.19.0/x64/src/testing/testing.go:1844 +0x7ec
  testing.(*M).Run()
      /Users/runner/hostedtoolcache/go/1.19.0/x64/src/testing/testing.go:1726 +0xa84
  main.main()
      _testmain.go:79 +0x2e9

Goroutine 16 (finished) created at:
  sigs.k8s.io/azuredisk-csi-driver/pkg/csi-common.(*nonBlockingGRPCServer).Start()
      /Users/runner/work/azuredisk-csi-driver/azuredisk-csi-driver/pkg/csi-common/server.go:56 +0x206
  sigs.k8s.io/azuredisk-csi-driver/pkg/csi-common.TestStart()
      /Users/runner/work/azuredisk-csi-driver/azuredisk-csi-driver/pkg/csi-common/server_test.go:37 +0xae
  testing.tRunner()
      /Users/runner/hostedtoolcache/go/1.19.0/x64/src/testing/testing.go:1446 +0x216
  testing.(*T).Run.func1()
      /Users/runner/hostedtoolcache/go/1.19.0/x64/src/testing/testing.go:1493 +0x47```

**Release note**:

Release note:

none

@k8s-ci-robot k8s-ci-robot added kind/test cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. labels Aug 10, 2022
@k8s-ci-robot
Copy link
Contributor

Hi @umagnus. 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 /ok-to-test on its own line. Until that is done, I will not automatically test new commits in this PR, but the usual testing commands by org members will still work. Regular contributors should join the org to skip this step.

Once the patch is verified, the new status will be reflected by the ok-to-test label.

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.

@k8s-ci-robot k8s-ci-robot added the size/L Denotes a PR that changes 100-499 lines, ignoring generated files. label Aug 10, 2022
add skipOnDarwin in TestNodePublishVolume and TestEnsureMountPoint
Copy link
Member

@andyzhangx andyzhangx left a comment

Choose a reason for hiding this comment

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

/ok-to-test
/lgtm
/approve

@k8s-ci-robot k8s-ci-robot added ok-to-test Indicates a non-member PR verified by an org member that is safe to test. and removed needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. labels Aug 10, 2022
@k8s-ci-robot k8s-ci-robot added lgtm "Looks good to me", indicates that a PR is ready to be merged. approved Indicates a PR has been approved by an approver from all required OWNERS files. labels Aug 10, 2022
@@ -175,6 +176,7 @@ func TestEnsureMountPoint(t *testing.T) {
desc: "[Error] Not a directory",
target: azuredisk,
skipOnWindows: true, // no error reported in windows
skipOnDarwin: true,
Copy link
Member

Choose a reason for hiding this comment

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

it should be pass in the beginning?

@andyzhangx
Copy link
Member

/hold

@k8s-ci-robot k8s-ci-robot added do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. and removed lgtm "Looks good to me", indicates that a PR is ready to be merged. labels Aug 10, 2022
Copy link
Member

@andyzhangx andyzhangx left a comment

Choose a reason for hiding this comment

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

/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 Aug 10, 2022
fix TestLogGRPC ut failure
Copy link
Member

@andyzhangx andyzhangx left a comment

Choose a reason for hiding this comment

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

/lgtm

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

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: andyzhangx, umagnus

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 merged commit 3023037 into kubernetes-sigs:master Aug 11, 2022
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. kind/test lgtm "Looks good to me", indicates that a PR is ready to be merged. ok-to-test Indicates a non-member PR verified by an org member that is safe to test. size/L Denotes a PR that changes 100-499 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

improve unit test coverage
3 participants