Skip to content

Commit

Permalink
Fix waiting for waitGroup in ScyllaCluster Orphaned PV e2e test
Browse files Browse the repository at this point in the history
  • Loading branch information
rzetelskik committed Sep 11, 2023
1 parent bcad2f6 commit e10e114
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions test/e2e/set/scyllacluster/scyllacluster_pv.go
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down Expand Up @@ -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{})
Expand Down

0 comments on commit e10e114

Please sign in to comment.