Skip to content

test(realtime): gate chat e2e send on SUBSCRIBED to fix flaky tests#2458

Draft
mandarini wants to merge 2 commits into
masterfrom
test/deflake-realtime-broadcast-e2e
Draft

test(realtime): gate chat e2e send on SUBSCRIBED to fix flaky tests#2458
mandarini wants to merge 2 commits into
masterfrom
test/deflake-realtime-broadcast-e2e

Conversation

@mandarini

@mandarini mandarini commented Jun 17, 2026

Copy link
Copy Markdown
Contributor

Fixes two flaky realtime broadcast tests that intermittently failed CI across many unrelated PRs. Both failures were readiness races, not network jitter: the tests interacted with a channel before it reached SUBSCRIBED.

In the realtime chat example, the Send button was enabled as soon as the input had text, so a click could land before the channel was wired up, causing sendMessage to early-return and the message-visible assertion to time out. Send is now disabled until the channel status is SUBSCRIBED, so Playwright auto-waits for readiness before clicking.

In the supabase-js browser integration test, the #realtime_status waits allowed only 2000ms to cover CDN script load, Babel transpile, websocket connect, and channel join, which is unrealistic in CI. The timeout is raised to 30000ms (the selector only renders once subscribed, so it remains an accurate readiness gate).

@github-actions github-actions Bot added the realtime-js Related to the realtime-js library. label Jun 17, 2026
@mandarini mandarini self-assigned this Jun 17, 2026
@pkg-pr-new

pkg-pr-new Bot commented Jun 17, 2026

Copy link
Copy Markdown

Open in StackBlitz

@supabase/auth-js

npm i https://pkg.pr.new/@supabase/auth-js@2458

@supabase/functions-js

npm i https://pkg.pr.new/@supabase/functions-js@2458

@supabase/postgrest-js

npm i https://pkg.pr.new/@supabase/postgrest-js@2458

@supabase/realtime-js

npm i https://pkg.pr.new/@supabase/realtime-js@2458

@supabase/storage-js

npm i https://pkg.pr.new/@supabase/storage-js@2458

@supabase/supabase-js

npm i https://pkg.pr.new/@supabase/supabase-js@2458

commit: ebb10f4

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

Labels

realtime-js Related to the realtime-js library.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant