diff --git a/api/client_test.go b/api/client_test.go index a3693a2fbc..f89d531527 100644 --- a/api/client_test.go +++ b/api/client_test.go @@ -757,7 +757,6 @@ func TestCloneWithHeadersNoDeadlock(t *testing.T) { wg := &sync.WaitGroup{} problematicFunc := func() { - wg.Add(1) client.SetCloneToken(true) _, err := client.CloneWithHeaders() if err != nil { @@ -767,6 +766,7 @@ func TestCloneWithHeadersNoDeadlock(t *testing.T) { } for i := 0; i < 1000; i++ { + wg.Add(1) go problematicFunc() } wg.Wait() @@ -783,7 +783,6 @@ func TestCloneNoDeadlock(t *testing.T) { wg := &sync.WaitGroup{} problematicFunc := func() { - wg.Add(1) client.SetCloneToken(true) _, err := client.Clone() if err != nil { @@ -793,6 +792,7 @@ func TestCloneNoDeadlock(t *testing.T) { } for i := 0; i < 1000; i++ { + wg.Add(1) go problematicFunc() } wg.Wait()