diff --git a/shared/relay/client/manager_test.go b/shared/relay/client/manager_test.go index d6b2e226a..4a7840dd7 100644 --- a/shared/relay/client/manager_test.go +++ b/shared/relay/client/manager_test.go @@ -4,6 +4,7 @@ import ( "context" "errors" "fmt" + "net" "net/netip" "testing" "time" @@ -535,7 +536,7 @@ func TestConnContextCauseOnLocalClose(t *testing.T) { t.Fatal("conn context was not cancelled after a local close") } - if cause := context.Cause(relayedConn.Context()); errors.Is(cause, ErrServerDisconnected) { - t.Errorf("local close must not be reported as a server disconnect, got: %v", cause) + if cause := context.Cause(relayedConn.Context()); !errors.Is(cause, net.ErrClosed) { + t.Errorf("unexpected cancellation cause after a local close: %v, want %v", cause, net.ErrClosed) } }