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

fix flaking test on TestTopologyParams #165

Merged
merged 1 commit into from
Mar 28, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,8 @@ verify: dep
PATH=$$(go env GOPATH)/bin:$$PATH repo-infra/verify/verify-boilerplate.sh

test: dep
go test ./controller
go test ./allocator
go test ./controller -v
go test ./allocator -v

clean:
rm -rf ./test/e2e/kubernetes
10 changes: 7 additions & 3 deletions controller/controller_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -924,7 +924,7 @@ func TestTopologyParams(t *testing.T) {
name: "provision with selected node",
objs: []runtime.Object{
newNode("node-1"),
newStorageClass("class-1", "foo.bar/baz"),
newStorageClassWithVolumeBindingMode("class-1", "foo.bar/baz", &modeWait),
newClaim("claim-1", "uid-1-1", "class-1", "foo.bar/baz", "", map[string]string{annSelectedNode: "node-1"}),
},
expectedParams: &provisionParams{
Expand All @@ -935,7 +935,11 @@ func TestTopologyParams(t *testing.T) {
name: "provision with AllowedTopologies and selected node",
objs: []runtime.Object{
newNode("node-1"),
newStorageClassWithAllowedTopologies("class-1", "foo.bar/baz", dummyAllowedTopology),
func() *storage.StorageClass {
sc := newStorageClassWithVolumeBindingMode("class-1", "foo.bar/baz", &modeWait)
sc.AllowedTopologies = dummyAllowedTopology
return sc
}(),
newClaim("claim-1", "uid-1-1", "class-1", "foo.bar/baz", "", map[string]string{annSelectedNode: "node-1"}),
},
expectedParams: &provisionParams{
Expand All @@ -946,7 +950,7 @@ func TestTopologyParams(t *testing.T) {
{
name: "provision with selected node, but node does not exist",
objs: []runtime.Object{
newStorageClass("class-1", "foo.bar/baz"),
newStorageClassWithVolumeBindingMode("class-1", "foo.bar/baz", &modeWait),
newClaim("claim-1", "uid-1-1", "class-1", "foo.bar/baz", "", map[string]string{annSelectedNode: "node-1"}),
},
expectedParams: nil,
Expand Down