Skip to content

Commit

Permalink
fix WebSocket error assertion
Browse files Browse the repository at this point in the history
  • Loading branch information
marten-seemann committed May 9, 2023
1 parent 1e2f471 commit f30bd71
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions p2p/test/transport/gating_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
}
})
Expand Down Expand Up @@ -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)
}
})
Expand Down Expand Up @@ -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)
}
})
Expand Down Expand Up @@ -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)
}
})
Expand Down Expand Up @@ -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)
}
})
Expand Down

0 comments on commit f30bd71

Please sign in to comment.