mirror of
https://github.com/tendermint/tendermint.git
synced 2026-08-21 06:36:19 +00:00
test: fix TestSwitchAcceptRoutine by ignoring spurious error (#6001)
Another fix for `TestSwitchAcceptRoutine` following from #6000, since the `SetDeadline()` call also errors when the connection has been closed.
This commit is contained in:
+1
-2
@@ -642,8 +642,7 @@ func TestSwitchAcceptRoutine(t *testing.T) {
|
||||
require.NoError(t, err)
|
||||
// check conn is closed
|
||||
one := make([]byte, 1)
|
||||
err = conn.SetReadDeadline(time.Now().Add(10 * time.Millisecond))
|
||||
require.NoError(t, err)
|
||||
_ = conn.SetReadDeadline(time.Now().Add(10 * time.Millisecond))
|
||||
_, err = conn.Read(one)
|
||||
assert.Error(t, err)
|
||||
assert.Equal(t, cfg.MaxNumInboundPeers, sw.Peers().Size())
|
||||
|
||||
Reference in New Issue
Block a user