Skip to content

Commit

Permalink
Fix SB test race (#3373)
Browse files Browse the repository at this point in the history
Co-authored-by: Bevan Arps <bevan.arps@microsoft.com>
  • Loading branch information
matthchr and theunrepentantgeek authored Oct 4, 2023
1 parent fa59534 commit 7303e13
Show file tree
Hide file tree
Showing 6 changed files with 30 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,10 @@ func Test_ServiceBus_Namespace_Basic_v1api20210101preview_CRUD(t *testing.T) {
ServiceBus_Queue_v1api20210101preview_CRUD(tc, namespace)
},
},
)

// This must run at the end as it modifies the namespace
tc.RunSubtests(
testcommon.Subtest{
Name: "Namespace secrets",
Test: func(tc *testcommon.KubePerTestContext) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,9 +38,15 @@ func Test_ServiceBus_Namespace_Basic_v1api20211101_CRUD(t *testing.T) {
ServiceBus_Queue_v1api20211101_CRUD(tc, namespace)
},
},
)

// This must run at the end as it modifies the namespace
tc.RunSubtests(
testcommon.Subtest{
Name: "Namespace secrets",
Test: func(tc *testcommon.KubePerTestContext) { ServiceBus_Namespace_Secrets_v1api20211101(tc, namespace) },
Test: func(tc *testcommon.KubePerTestContext) {
ServiceBus_Namespace_Secrets_v1api20211101(tc, namespace)
},
},
)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,13 +38,16 @@ func Test_ServiceBus_Namespace_Basic_v1api20221001preview_CRUD(t *testing.T) {
ServiceBus_NamespacesQueue_v1api20221001preview_CRUD(tc, namespace)
},
},
)

// This must run at the end as it modifies the namespace
tc.RunSubtests(
testcommon.Subtest{
Name: "Namespace secrets",
Test: func(tc *testcommon.KubePerTestContext) {
ServiceBus_Namespace_Secrets_v1api20221001preview(tc, namespace)
},
},
)
})

tc.DeleteResourceAndWait(namespace)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,13 +51,16 @@ func Test_ServiceBus_Namespace_Standard_v1api20210101preview_CRUD(t *testing.T)
ServiceBus_NamespacesAuthorizationRule_v1api20210101preview_CRUD(tc, namespace)
},
},
)

// This must run at the end as it modifies the namespace
tc.RunSubtests(
testcommon.Subtest{
Name: "NamespaceSecrets CRUD",
Test: func(tc *testcommon.KubePerTestContext) {
ServiceBus_Namespace_Secrets_v1api20210101preview(tc, namespace)
},
},
)
})

tc.DeleteResourceAndWait(namespace)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,10 @@ func Test_ServiceBus_Namespace_Standard_v1api20211101_CRUD(t *testing.T) {
ServiceBus_NamespacesAuthorizationRule_v1api20211101_CRUD(tc, namespace)
},
},
)

// This must run at the end as it modifies the namespace
tc.RunSubtests(
testcommon.Subtest{
Name: "NamespaceSecrets CRUD",
Test: func(tc *testcommon.KubePerTestContext) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,13 +51,16 @@ func Test_ServiceBus_Namespace_Standard_v1api20221001preview_CRUD(t *testing.T)
ServiceBus_AuthorizationRule_v1api20221001preview_CRUD(tc, namespace)
},
},
)

// This must run at the end as it modifies the namespace.
tc.RunSubtests(
testcommon.Subtest{
Name: "NamespaceSecrets CRUD",
Test: func(tc *testcommon.KubePerTestContext) {
ServiceBus_Namespace_Secrets_v1api20221001preview(tc, namespace)
},
},
)
})

tc.DeleteResourceAndWait(namespace)

Expand Down

0 comments on commit 7303e13

Please sign in to comment.