mirror of
https://github.com/drakkan/sftpgo.git
synced 2024-11-25 00:50:31 +00:00
test cases: fix some random failures
Signed-off-by: Nicola Murino <nicola.murino@gmail.com>
This commit is contained in:
parent
7a12db6cdb
commit
4a414f0fa4
2 changed files with 6 additions and 2 deletions
|
@ -13556,7 +13556,9 @@ func TestMaxTransfers(t *testing.T) {
|
||||||
err = os.RemoveAll(user.GetHomeDir())
|
err = os.RemoveAll(user.GetHomeDir())
|
||||||
assert.NoError(t, err)
|
assert.NoError(t, err)
|
||||||
assert.Len(t, common.Connections.GetStats(""), 0)
|
assert.Len(t, common.Connections.GetStats(""), 0)
|
||||||
assert.Equal(t, int32(0), common.Connections.GetTotalTransfers())
|
assert.Eventually(t, func() bool {
|
||||||
|
return common.Connections.GetTotalTransfers() == 0
|
||||||
|
}, 1000*time.Millisecond, 50*time.Millisecond)
|
||||||
|
|
||||||
common.Config.MaxPerHostConnections = oldValue
|
common.Config.MaxPerHostConnections = oldValue
|
||||||
}
|
}
|
||||||
|
|
|
@ -4457,7 +4457,9 @@ func TestMaxTransfers(t *testing.T) {
|
||||||
assert.NoError(t, err)
|
assert.NoError(t, err)
|
||||||
err = os.RemoveAll(user.GetHomeDir())
|
err = os.RemoveAll(user.GetHomeDir())
|
||||||
assert.NoError(t, err)
|
assert.NoError(t, err)
|
||||||
assert.Equal(t, int32(0), common.Connections.GetTotalTransfers())
|
assert.Eventually(t, func() bool {
|
||||||
|
return common.Connections.GetTotalTransfers() == 0
|
||||||
|
}, 1000*time.Millisecond, 50*time.Millisecond)
|
||||||
|
|
||||||
common.Config.MaxPerHostConnections = oldValue
|
common.Config.MaxPerHostConnections = oldValue
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue