Skip to content

Conversation

mishraa-G
Copy link
Contributor

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 rjl493456442 changed the title rpc: tolerate "connection reset by peer" error in TestServerWebsocketReadLimit rpc: fix flaky test TestServerWebsocketReadLimit Oct 15, 2025
@rjl493456442 rjl493456442 merged commit 3cfc334 into ethereum:master Oct 15, 2025
6 of 7 checks passed
@rjl493456442 rjl493456442 added this to the 1.16.5 milestone Oct 15, 2025
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