test(realtime): gate chat e2e send on SUBSCRIBED to fix flaky tests#2458
Draft
mandarini wants to merge 2 commits into
Draft
test(realtime): gate chat e2e send on SUBSCRIBED to fix flaky tests#2458mandarini wants to merge 2 commits into
mandarini wants to merge 2 commits into
Conversation
@supabase/auth-js
@supabase/functions-js
@supabase/postgrest-js
@supabase/realtime-js
@supabase/storage-js
@supabase/supabase-js
commit: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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
sendMessageto early-return and the message-visible assertion to time out. Send is now disabled until the channel status isSUBSCRIBED, so Playwright auto-waits for readiness before clicking.In the supabase-js browser integration test, the
#realtime_statuswaits 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).