mirror of
https://github.com/fluencelabs/tendermint
synced 2025-07-30 19:51:58 +00:00
p2p: exponential backoff on reconnect. closes #939
This commit is contained in:
@@ -272,10 +272,10 @@ func TestSwitchReconnectsToPersistentPeer(t *testing.T) {
|
||||
// simulate failure by closing connection
|
||||
peer.CloseConn()
|
||||
|
||||
// TODO: actually detect the disconnection and wait for reconnect
|
||||
// TODO: remove sleep, detect the disconnection, wait for reconnect
|
||||
npeers := sw.Peers().Size()
|
||||
for i := 0; i < 20; i++ {
|
||||
time.Sleep(100 * time.Millisecond)
|
||||
time.Sleep(250 * time.Millisecond)
|
||||
npeers = sw.Peers().Size()
|
||||
if npeers > 0 {
|
||||
break
|
||||
|
Reference in New Issue
Block a user