mirror of
https://github.com/optim-enterprises-bv/vault.git
synced 2025-10-30 18:17:55 +00:00
Move wg.Add outside of goroutine (#25104)
* Move wg.Add outside of goroutine * Fix other test
This commit is contained in:
@@ -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()
|
||||
|
||||
Reference in New Issue
Block a user