mirror of
https://github.com/optim-enterprises-bv/vault.git
synced 2025-11-01 11:08:10 +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{}
|
wg := &sync.WaitGroup{}
|
||||||
|
|
||||||
problematicFunc := func() {
|
problematicFunc := func() {
|
||||||
wg.Add(1)
|
|
||||||
client.SetCloneToken(true)
|
client.SetCloneToken(true)
|
||||||
_, err := client.CloneWithHeaders()
|
_, err := client.CloneWithHeaders()
|
||||||
if err != nil {
|
if err != nil {
|
||||||
@@ -767,6 +766,7 @@ func TestCloneWithHeadersNoDeadlock(t *testing.T) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
for i := 0; i < 1000; i++ {
|
for i := 0; i < 1000; i++ {
|
||||||
|
wg.Add(1)
|
||||||
go problematicFunc()
|
go problematicFunc()
|
||||||
}
|
}
|
||||||
wg.Wait()
|
wg.Wait()
|
||||||
@@ -783,7 +783,6 @@ func TestCloneNoDeadlock(t *testing.T) {
|
|||||||
wg := &sync.WaitGroup{}
|
wg := &sync.WaitGroup{}
|
||||||
|
|
||||||
problematicFunc := func() {
|
problematicFunc := func() {
|
||||||
wg.Add(1)
|
|
||||||
client.SetCloneToken(true)
|
client.SetCloneToken(true)
|
||||||
_, err := client.Clone()
|
_, err := client.Clone()
|
||||||
if err != nil {
|
if err != nil {
|
||||||
@@ -793,6 +792,7 @@ func TestCloneNoDeadlock(t *testing.T) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
for i := 0; i < 1000; i++ {
|
for i := 0; i < 1000; i++ {
|
||||||
|
wg.Add(1)
|
||||||
go problematicFunc()
|
go problematicFunc()
|
||||||
}
|
}
|
||||||
wg.Wait()
|
wg.Wait()
|
||||||
|
|||||||
Reference in New Issue
Block a user