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

Flaky test: TestVolumeCreateClusterOpts #3636

Closed
thaJeztah opened this issue May 28, 2022 · 1 comment · Fixed by #3641
Closed

Flaky test: TestVolumeCreateClusterOpts #3636

thaJeztah opened this issue May 28, 2022 · 1 comment · Fixed by #3641

Comments

@thaJeztah
Copy link
Member

Looks like we have a new flaky test; I'm guessing something is using a map, and therefore randomized by Go. Introduced in #3606

--- FAIL: TestVolumeCreateClusterOpts (0.00s)
    create_test.go:195: assertion failed: 
        --- body
        +++ expectedBody
          volume.CreateOptions{
          	ClusterVolumeSpec: &volume.ClusterVolumeSpec{
          		... // 2 identical fields
          		AccessibilityRequirements: &{Requisite: {{Segments: {"region": "R1", "zone": "Z1"}}, {Segments: {"region": "R1", "zone": "Z2"}}, {Segments: {"region": "R1", "zone": "Z3"}}}, Preferred: {{Segments: {"region": "R1", "zone": "Z2"}}, {Segments: {"region": "R1", "zone": "Z3"}}}},
          		CapacityRange:             &{RequiredBytes: 1234, LimitBytes: 567890},
          		Secrets: []volume.Secret{
        - 			{Key: "key2", Secret: "secret2"},
          			{Key: "key1", Secret: "secret1"},
        + 			{Key: "key2", Secret: "secret2"},
          		},
          		Availability: "active",
          	},
          	Driver:     "csi",
          	DriverOpts: {},
          	... // 2 identical fields
          }

/cc @dperny

@photra
Copy link
Contributor

photra commented May 31, 2022

I also encountered this flaky test when working on another PR. It looks like the snippet below is the root cause:

for key, secret := range options.secrets.GetAll() {
volOpts.ClusterVolumeSpec.Secrets = append(
volOpts.ClusterVolumeSpec.Secrets,
volume.Secret{
Key: key,
Secret: secret,
},
)
}

Like @thaJeztah suggested,options.secrets.GetAll() returns a map, which is then parsed into a slice, leading to randomized ordering of secrets. I will follow up with a PR to deflake TestVolumeCreateClusterOpts

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants