Browse Source
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.
pull/6006/head
Erik Grinaker
4 years ago
committed by
GitHub
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with
1 additions and
2 deletions
-
p2p/switch_test.go
|
|
@ -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()) |
|
|
|