mirror of
https://github.com/drakkan/sftpgo.git
synced 2025-12-07 14:50:55 +03:00
fix concurrency test case on go 1.13
a sleep seems required, needs investigation
This commit is contained in:
@@ -385,11 +385,10 @@ func TestConcurrency(t *testing.T) {
|
|||||||
}
|
}
|
||||||
}(i)
|
}(i)
|
||||||
}
|
}
|
||||||
var statsWg sync.WaitGroup
|
|
||||||
statsWg.Add(1)
|
|
||||||
|
|
||||||
|
wg.Add(1)
|
||||||
go func() {
|
go func() {
|
||||||
defer statsWg.Done()
|
defer wg.Done()
|
||||||
|
|
||||||
maxConns := 0
|
maxConns := 0
|
||||||
maxSessions := 0
|
maxSessions := 0
|
||||||
@@ -408,13 +407,13 @@ func TestConcurrency(t *testing.T) {
|
|||||||
if servedReqs >= int32(numLogins) {
|
if servedReqs >= int32(numLogins) {
|
||||||
break
|
break
|
||||||
}
|
}
|
||||||
|
time.Sleep(1 * time.Millisecond)
|
||||||
}
|
}
|
||||||
assert.Greater(t, maxConns, 0)
|
assert.Greater(t, maxConns, 0)
|
||||||
assert.Greater(t, maxSessions, 0)
|
assert.Greater(t, maxSessions, 0)
|
||||||
}()
|
}()
|
||||||
|
|
||||||
wg.Wait()
|
wg.Wait()
|
||||||
statsWg.Wait()
|
|
||||||
|
|
||||||
client, err := getSftpClient(user, usePubKey)
|
client, err := getSftpClient(user, usePubKey)
|
||||||
if assert.NoError(t, err) {
|
if assert.NoError(t, err) {
|
||||||
|
|||||||
Reference in New Issue
Block a user