Skip to content

Flaky test: WebSocket ping interval test fails intermittently on macOS-latest #208

@coderabbitai

Description

@coderabbitai

Description

A flaky test was detected in the CI pipeline for PR #207.

Test Details

Test Name: WebSocket Tests Given a web socket connection with a ping interval, when the client side blocks, then the server socket closes

Location: test/web_socket/web_socket_test.dart:354

Platform: macOS-latest (Dart stable, upgrade)

Failure Details

The test failed on the first run attempt but passed on retry.

Expected behavior:

• emit an event that <Instance of 'TextDataReceived'>
• emit an event that CloseReceived:<CloseReceived(1001, )>
• be done

Actual behavior:

emitted • CloseReceived(1001, )
x Stream closed.
which didn't emit an event that <Instance of 'TextDataReceived'>

Error:

TimeoutException after 0:00:30.000000: Test timed out after 30 seconds.

Links

Observations

This appears to be a race condition or timing issue specific to macOS runners. The test expects to receive a TextDataReceived event before the CloseReceived event, but on macOS the close event is sometimes received first.

The test succeeded on retry, confirming its flaky nature.

Suggested Actions

  • Investigate the timing assumptions in the websocket ping interval test
  • Consider adding more lenient timing expectations for macOS platform
  • Review if the test's expectations about event ordering are too strict

Reported by: @SandPod in #207

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingtestIssues related to testing.

    Type

    No type

    Projects

    Status

    Backlog 🗂️

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions