Skip to content

Commit

Permalink
tests: fix data race in TestKonnectEntities (#860)
Browse files Browse the repository at this point in the history
  • Loading branch information
pmalek authored Nov 13, 2024
1 parent 6681d63 commit 6e79770
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions test/integration/test_konnect_entities.go
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ func TestKonnectEntities(t *testing.T) {
deploy.WithTestIDLabel(testID),
)

t.Cleanup(deleteObjectAndWaitForDeletionFn(t, cp))
t.Cleanup(deleteObjectAndWaitForDeletionFn(t, cp.DeepCopy()))

t.Logf("Waiting for Konnect ID to be assigned to ControlPlane %s/%s", cp.Namespace, cp.Name)
require.EventuallyWithT(t, func(t *assert.CollectT) {
Expand All @@ -83,7 +83,7 @@ func TestKonnectEntities(t *testing.T) {
kr.Spec.KongRouteAPISpec.Paths = []string{"/kr-" + testID}
},
)
t.Cleanup(deleteObjectAndWaitForDeletionFn(t, kr))
t.Cleanup(deleteObjectAndWaitForDeletionFn(t, kr.DeepCopy()))

t.Logf("Waiting for KongRoute to be updated with Konnect ID")
require.EventuallyWithT(t, func(t *assert.CollectT) {
Expand Down Expand Up @@ -179,7 +179,7 @@ func TestKonnectEntities(t *testing.T) {
}, testutils.ObjectUpdateTimeout, testutils.ObjectUpdateTick)

// Should delete KongTarget because it will block deletion of KongUpstream owning it.
t.Cleanup(deleteObjectAndWaitForDeletionFn(t, kt))
t.Cleanup(deleteObjectAndWaitForDeletionFn(t, kt.DeepCopy()))

kv := deploy.KongVaultAttachedToCP(t, ctx, clientNamespaced, "env", "env-vault", []byte(`{"prefix":"env-vault"}`), cp)
t.Logf("Waiting for KongVault to be updated with Konnect ID")
Expand Down

0 comments on commit 6e79770

Please sign in to comment.