Skip to content

Conversation

mishraa-G
Copy link

Fix: Tolerate "connection reset by peer" in TestServerWebsocketReadLimit

What does this PR do?

This PR updates the TestServerWebsocketReadLimit test to tolerate the "connection reset by peer" error as a valid outcome when the websocket read limit is exceeded.
This error can occur due to a race condition where the TCP connection closes before the websocket close frame is sent, as discussed in issue #32866.

Why is this needed?

Occasionally, in CI or some local environments, the test fails with:

unexpected error for read limit violation: write tcp ...: write: connection reset by peer

Previously, the test only accepted specific websocket errors (like CloseError code 1009, ErrReadLimit, or errors containing "1009"/"message too big").
By allowing "connection reset by peer", the test becomes more robust against this race condition and prevents intermittent failures.

Reference

Fixes #32866

Checklist

  • Ran tests locally
  • Only test code changed

Let me know if you want to edit or clarify anything!

@rjl493456442
Copy link
Member

Fixed by #32899

Thanks for reporting it

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

TestServerWebsocketReadLimit failure due to race condition

3 participants