Skip to content

WebSocket integration tests fail in CI but pass locally #3

@rjcorwin

Description

@rjcorwin

Problem

Two WebSocket integration tests in the gateway package fail consistently in GitHub Actions CI but pass locally:

  • should establish WebSocket connection with valid token
  • should handle multiple participants in same topic

Symptoms

  • Tests timeout waiting for WebSocket welcome messages
  • Connection is successfully established (logs show "Participant joined topic")
  • Welcome message is never received in CI environment
  • Same tests pass without issues when run locally

Error Output

Error: Welcome message timeout
 ❯ Timeout._onTimeout tests/helpers/testUtils.ts:104:14

Attempted Solutions

  1. Increased test timeouts from 5s → 10s → 20s
  2. Increased helper function timeouts from 5s → 8s → 15s
  3. Still fails even with 15-second timeouts

Current Workaround

Tests are currently skipped in PR #2 to unblock CI pipeline.

Investigation Needed

  • Why do WebSocket messages fail to deliver in GitHub Actions?
  • Is there a specific configuration needed for WebSocket tests in CI?
  • Could this be related to how GitHub Actions handles network connections?

Environment

  • Local: macOS, Node.js (tests pass)
  • CI: GitHub Actions, Ubuntu (tests fail)

Related

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions