Move wg.Add outside of goroutine (#25104)

* Move wg.Add outside of goroutine

* Fix other test
This commit is contained in:
Violet Hynes
2024-01-26 14:01:54 -05:00
committed by GitHub
parent ebf3f56877
commit 3ba802d8dc

View File

@@ -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()