mirror of
https://github.com/tendermint/tendermint.git
synced 2026-01-07 05:46:32 +00:00
some more robust sleeps
This commit is contained in:
@@ -81,7 +81,7 @@ func _waitForTxs(t *testing.T, wg *sync.WaitGroup, txs types.Txs, reactorIdx int
|
||||
|
||||
mempool := reactors[reactorIdx].Mempool
|
||||
for mempool.Size() != len(txs) {
|
||||
time.Sleep(time.Second)
|
||||
time.Sleep(time.Millisecond * 100)
|
||||
}
|
||||
|
||||
reapedTxs := mempool.Reap(len(txs))
|
||||
|
||||
@@ -262,9 +262,15 @@ func TestSwitchReconnectsToPersistentPeer(t *testing.T) {
|
||||
peer.CloseConn()
|
||||
|
||||
// TODO: actually detect the disconnection and wait for reconnect
|
||||
time.Sleep(100 * time.Millisecond)
|
||||
|
||||
assert.NotZero(sw.Peers().Size())
|
||||
npeers := sw.Peers().Size()
|
||||
for i := 0; i < 20; i++ {
|
||||
time.Sleep(100 * time.Millisecond)
|
||||
npeers = sw.Peers().Size()
|
||||
if npeers > 0 {
|
||||
break
|
||||
}
|
||||
}
|
||||
assert.NotZero(npeers)
|
||||
assert.False(peer.IsRunning())
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user