mirror of
https://github.com/drakkan/sftpgo.git
synced 2025-12-06 14:20: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)
|
||||
}
|
||||
var statsWg sync.WaitGroup
|
||||
statsWg.Add(1)
|
||||
|
||||
wg.Add(1)
|
||||
go func() {
|
||||
defer statsWg.Done()
|
||||
defer wg.Done()
|
||||
|
||||
maxConns := 0
|
||||
maxSessions := 0
|
||||
@@ -408,13 +407,13 @@ func TestConcurrency(t *testing.T) {
|
||||
if servedReqs >= int32(numLogins) {
|
||||
break
|
||||
}
|
||||
time.Sleep(1 * time.Millisecond)
|
||||
}
|
||||
assert.Greater(t, maxConns, 0)
|
||||
assert.Greater(t, maxSessions, 0)
|
||||
}()
|
||||
|
||||
wg.Wait()
|
||||
statsWg.Wait()
|
||||
|
||||
client, err := getSftpClient(user, usePubKey)
|
||||
if assert.NoError(t, err) {
|
||||
|
||||
Reference in New Issue
Block a user