Skip to content

TestServerWebsocketReadLimit failure due to race condition #32866

@hero5512

Description

@hero5512

System information

Geth version: master branch
OS & Version: Any
Commit hash: current master branch

Expected behaviour

The test TestServerWebsocketReadLimit should pass consistently in CI and local environments.

Actual behaviour

The test fails intermittently in CI with:

--- FAIL: TestServerWebsocketReadLimit (0.01s)
    --- FAIL: TestServerWebsocketReadLimit/limit_with_large_request_-_should_fail (0.00s)
        server_test.go:278: unexpected error for read limit violation: write tcp 127.0.0.1:33636->127.0.0.1:39835: write: connection reset by peer
FAIL

The test expects specific error types (CloseError with code 1009, ErrReadLimit, or errors containing "1009"/"message too big") but fails when it receives a "connection reset by peer" error.

Steps to reproduce the behaviour

CI failure example: https://github.com/ethereum/go-ethereum/actions/runs/18361445866/job/52306116362?pr=32856

Root Cause Analysis

The error may be caused by the TCP connection closing before the WebSocket close frame is sent, resulting in a “connection reset” instead of a proper close message.

Proposed Solution

Update the test to accept connection reset error

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions