Skip to content

fix(desktop): resolve flaky integration tests via project-level assertion timeout#812

Merged
wpfleger96 merged 2 commits into
mainfrom
wpfleger/fix-flaky-integration-tests
Jun 1, 2026
Merged

fix(desktop): resolve flaky integration tests via project-level assertion timeout#812
wpfleger96 merged 2 commits into
mainfrom
wpfleger/fix-flaky-integration-tests

Conversation

@wpfleger96

Copy link
Copy Markdown
Collaborator

Integration tests in stream.spec.ts were flaky because 10 expect.poll() and 3 toHaveCount() calls used Playwright's default 5-second assertion timeout. Under CI load, scroll-position and badge assertions timed out before the UI settled after relay delivery. test.slow() only triples the test-level timeout, not assertion timeouts — so these assertions had 5s regardless.

The relay ack is already correct (sendChannelMessage blocks until the relay persists and fans out via HTTP POST), so no send-side fix was needed. The fix is purely on the observation side.

  • Set expect.timeout on the integration Playwright project (15s CI, 10s local) so all assertions inherit a consistent timeout
  • Remove per-file relayDeliveryTimeoutMs constants and per-call { timeout } overrides from stream.spec.ts and integration.spec.ts
  • Smoke tests unchanged — keep the default 5s assertion timeout since the mock bridge delivers synchronously
  • Cherry-pick lint fix commit (23 biome warnings across desktop and web)

…tion timeout

stream.spec.ts had 10 expect.poll() and 3 toHaveCount() calls using
Playwright's default 5s assertion timeout. Under CI load, scroll-position
and badge assertions timed out before the UI settled after relay delivery.
test.slow() only triples the test-level timeout, not assertion timeouts.

Set expect.timeout on the integration Playwright project (15s CI, 10s local)
so all assertions inherit a consistent timeout. Remove per-file
relayDeliveryTimeoutMs constants and per-call timeout overrides.
Replace non-null assertions with type-narrowing guards, string
concatenation with template literals, computed string keys with dot
notation, and verbose null-checks with optional chaining.
@wpfleger96 wpfleger96 requested a review from a team as a code owner June 1, 2026 22:31
@wpfleger96 wpfleger96 merged commit 6481428 into main Jun 1, 2026
15 checks passed
@wpfleger96 wpfleger96 deleted the wpfleger/fix-flaky-integration-tests branch June 1, 2026 22:48
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.

1 participant