Skip to content

test(e2e): channel WS assertions race initial channel loading #2086

Description

@n30nex

The core browser suite's #1468 WebSocket checks take before, mutation, and after snapshots in separate page.evaluate calls. The initial /api/channels response can settle between those calls, changing channel state independently of the packet being tested.

Observed during a full local run: before=0, after=5 failed the orphan-message count assertion even though no unknown channel was created.

Reproduced on unchanged 9eb3098 by holding the real /api/channels response until after the first snapshot, then letting it complete before injecting the orphan message. Result:

{"before":0,"after":5,"unknown":false,"legacyCountAssertion":false}

This is a test synchronization bug, not evidence that orphan packets are being accepted. The companion positive-control test also splits its state reads and injected packet across browser turns, so initialization can overwrite its sentinel before the final snapshot.

Expected: collect the before state, synchronously process the test packet, and collect the after state in a single browser evaluation for each check. Keep every existing assertion. No sleeps, retries, forced channel data, or production changes are needed. Verify both checks with delayed initial loading and confirm the full browser suite passes.

Activity

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions