From 7de8ed530cc833a1ab90b085b8d20fdfd683fe87 Mon Sep 17 00:00:00 2001 From: Matthew Christopher Date: Tue, 3 Oct 2023 15:55:45 -0700 Subject: [PATCH] Fix SB test race --- ...ervicebus_namespace_basic_v1api20210101preview_test.go | 4 ++++ .../crd_servicebus_namespace_basic_v1api20211101_test.go | 8 +++++++- ...ervicebus_namespace_basic_v1api20221001preview_test.go | 7 +++++-- ...icebus_namespace_standard_v1api20210101preview_test.go | 7 +++++-- ...rd_servicebus_namespace_standard_v1api20211101_test.go | 4 ++++ ...icebus_namespace_standard_v1api20221001preview_test.go | 7 +++++-- 6 files changed, 30 insertions(+), 7 deletions(-) diff --git a/v2/internal/controllers/crd_servicebus_namespace_basic_v1api20210101preview_test.go b/v2/internal/controllers/crd_servicebus_namespace_basic_v1api20210101preview_test.go index c0b05fb7ca1..34a7a4a6019 100644 --- a/v2/internal/controllers/crd_servicebus_namespace_basic_v1api20210101preview_test.go +++ b/v2/internal/controllers/crd_servicebus_namespace_basic_v1api20210101preview_test.go @@ -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) { diff --git a/v2/internal/controllers/crd_servicebus_namespace_basic_v1api20211101_test.go b/v2/internal/controllers/crd_servicebus_namespace_basic_v1api20211101_test.go index aee886ea23b..bc1f01fdfb0 100644 --- a/v2/internal/controllers/crd_servicebus_namespace_basic_v1api20211101_test.go +++ b/v2/internal/controllers/crd_servicebus_namespace_basic_v1api20211101_test.go @@ -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) + }, }, ) diff --git a/v2/internal/controllers/crd_servicebus_namespace_basic_v1api20221001preview_test.go b/v2/internal/controllers/crd_servicebus_namespace_basic_v1api20221001preview_test.go index 03813eac2c4..b8f04323d9f 100644 --- a/v2/internal/controllers/crd_servicebus_namespace_basic_v1api20221001preview_test.go +++ b/v2/internal/controllers/crd_servicebus_namespace_basic_v1api20221001preview_test.go @@ -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) diff --git a/v2/internal/controllers/crd_servicebus_namespace_standard_v1api20210101preview_test.go b/v2/internal/controllers/crd_servicebus_namespace_standard_v1api20210101preview_test.go index 813e624da1f..ce108278f2f 100644 --- a/v2/internal/controllers/crd_servicebus_namespace_standard_v1api20210101preview_test.go +++ b/v2/internal/controllers/crd_servicebus_namespace_standard_v1api20210101preview_test.go @@ -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) diff --git a/v2/internal/controllers/crd_servicebus_namespace_standard_v1api20211101_test.go b/v2/internal/controllers/crd_servicebus_namespace_standard_v1api20211101_test.go index 14f9b063cc1..4c41911c9b2 100644 --- a/v2/internal/controllers/crd_servicebus_namespace_standard_v1api20211101_test.go +++ b/v2/internal/controllers/crd_servicebus_namespace_standard_v1api20211101_test.go @@ -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) { diff --git a/v2/internal/controllers/crd_servicebus_namespace_standard_v1api20221001preview_test.go b/v2/internal/controllers/crd_servicebus_namespace_standard_v1api20221001preview_test.go index 3d68f60903f..81d52993dc9 100644 --- a/v2/internal/controllers/crd_servicebus_namespace_standard_v1api20221001preview_test.go +++ b/v2/internal/controllers/crd_servicebus_namespace_standard_v1api20221001preview_test.go @@ -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)