From e10e1148ebe9a51a95172d5b533a3321cd6abd75 Mon Sep 17 00:00:00 2001 From: Kacper Rzetelski Date: Mon, 11 Sep 2023 17:18:04 +0200 Subject: [PATCH] Fix waiting for waitGroup in ScyllaCluster Orphaned PV e2e test --- test/e2e/set/scyllacluster/scyllacluster_pv.go | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/test/e2e/set/scyllacluster/scyllacluster_pv.go b/test/e2e/set/scyllacluster/scyllacluster_pv.go index f84337cfdf8..84229f65376 100644 --- a/test/e2e/set/scyllacluster/scyllacluster_pv.go +++ b/test/e2e/set/scyllacluster/scyllacluster_pv.go @@ -99,10 +99,12 @@ var _ = g.Describe("ScyllaCluster Orphaned PV controller", func() { // ScyllaCluster is going to request a PVC from that StorageClass, and the test is going to request a clone of the original PVC // from the default StorageClass to get any storage. Then the bound PV is rebounded to the original PVC // but with empty NodeAffinity. This allows the test to trigger the orphaned PV cleanup logic. - provisionerCtx, provisionerCancel := context.WithCancel(ctx) + var wg sync.WaitGroup + defer wg.Wait() + + provisionerCtx, provisionerCancel := context.WithCancel(context.Background()) defer provisionerCancel() - var wg sync.WaitGroup wg.Add(1) go func() { defer wg.Done() @@ -252,7 +254,6 @@ var _ = g.Describe("ScyllaCluster Orphaned PV controller", func() { } o.Expect(err).NotTo(o.HaveOccurred()) }() - defer wg.Wait() framework.By("Creating a ScyllaCluster") sc, err = f.ScyllaClient().ScyllaV1().ScyllaClusters(f.Namespace()).Create(ctx, sc, metav1.CreateOptions{})