diff --git a/p2p/test/transport/gating_test.go b/p2p/test/transport/gating_test.go index bc3b18826f..408350bf2e 100644 --- a/p2p/test/transport/gating_test.go +++ b/p2p/test/transport/gating_test.go @@ -92,7 +92,7 @@ func TestInterceptSecuredOutgoing(t *testing.T) { require.Error(t, cerr) // There's a bug in the WebSocket library, making Close block for up to 5s. // See https://github.com/nhooyr/websocket/issues/355 for details. - if _, err := h2.Addrs()[0].ValueForProtocol(ma.P_WS); err == nil { + if _, err := h2.Addrs()[0].ValueForProtocol(ma.P_WS); err != nil { require.NotErrorIs(t, cerr, context.DeadlineExceeded) } }) @@ -126,7 +126,7 @@ func TestInterceptUpgradedOutgoing(t *testing.T) { require.Error(t, cerr) // There's a bug in the WebSocket library, making Close block for up to 5s. // See https://github.com/nhooyr/websocket/issues/355 for details. - if _, err := h2.Addrs()[0].ValueForProtocol(ma.P_WS); err == nil { + if _, err := h2.Addrs()[0].ValueForProtocol(ma.P_WS); err != nil { require.NotErrorIs(t, cerr, context.DeadlineExceeded) } }) @@ -156,7 +156,7 @@ func TestInterceptAccept(t *testing.T) { require.Error(t, cerr) // There's a bug in the WebSocket library, making Close block for up to 5s. // See https://github.com/nhooyr/websocket/issues/355 for details. - if _, err := h2.Addrs()[0].ValueForProtocol(ma.P_WS); err == nil { + if _, err := h2.Addrs()[0].ValueForProtocol(ma.P_WS); err != nil { require.NotErrorIs(t, cerr, context.DeadlineExceeded) } }) @@ -189,7 +189,7 @@ func TestInterceptSecuredIncoming(t *testing.T) { require.Error(t, cerr) // There's a bug in the WebSocket library, making Close block for up to 5s. // See https://github.com/nhooyr/websocket/issues/355 for details. - if _, err := h2.Addrs()[0].ValueForProtocol(ma.P_WS); err == nil { + if _, err := h2.Addrs()[0].ValueForProtocol(ma.P_WS); err != nil { require.NotErrorIs(t, cerr, context.DeadlineExceeded) } }) @@ -222,7 +222,7 @@ func TestInterceptUpgradedIncoming(t *testing.T) { require.Error(t, cerr) // There's a bug in the WebSocket library, making Close block for up to 5s. // See https://github.com/nhooyr/websocket/issues/355 for details. - if _, err := h2.Addrs()[0].ValueForProtocol(ma.P_WS); err == nil { + if _, err := h2.Addrs()[0].ValueForProtocol(ma.P_WS); err != nil { require.NotErrorIs(t, cerr, context.DeadlineExceeded) } })