Skip to content

test(e2e/studio): drop racy post-action waits in database specs (from #46424) - #47106

Merged
awaseem merged 2 commits into
masterfrom
alaister/e2e-database-race-fixes
Jun 22, 2026
Merged

awaseem merged 2 commits into
masterfrom
alaister/e2e-database-race-fixes

Conversation

@alaister

@alaister alaister commented Jun 19, 2026 •

Copy link
Copy Markdown
Member

Follow-up to #47077, extracted from the TanStack Start migration (#46424).

Three waitForResponse waits in database.spec.ts were registered after their triggering action, so the response could resolve before the listener attached and the wait would time out (this surfaced under TanStack, where the data is SSR-streamed, but the waits are redundant on Next too).

Removed:

  • Schema Visualizer actions: waitForSchemaVisualizerToLoad(...'auth') registered after the schema-selector click — the focusTableInVisualizer loop immediately below already auto-waits for the auth schema's tables.
  • table update / duplicate: waitForDatabaseToLoad(...) after the save mutation — the toBeVisible assertion right after each already waits for the list to refetch.
  • the now-unused waitForDatabaseToLoad / waitForSchemaVisualizerToLoad imports.

The UI assertions are the real synchronization points, so behaviour is unchanged on Next.

To test

  • Studio E2E database.spec.ts passes (the Schema Visualizer + Tables groups).

Summary by CodeRabbit

  • Tests
    • Improved database e2e test reliability by optimizing synchronization logic and eliminating timing-sensitive helpers that could introduce flakiness during schema and table operations.

…s (from #46424)

Follow-up to #47077. Three more waitForResponse waits in database.spec were
registered *after* their triggering action, so they could miss the (under
TanStack, SSR-streamed) response and time out:

- Schema Visualizer 'actions': waitForSchemaVisualizerToLoad('auth') after the
  schema-selector click — the focusTableInVisualizer loop below already gates.
- table update / duplicate: waitForDatabaseToLoad after the save mutation — the
  toBeVisible assertion right after each already waits for the list refetch.

Remove all three (and the now-unused imports). Framework-agnostic; the UI
assertions are the real gates.
@vercel

vercel Bot commented Jun 19, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
design-system Ready Ready Preview, Comment Jun 22, 2026 1:36pm
docs Ready Ready Preview, Comment, Open in v0 Jun 22, 2026 1:36pm
studio-self-hosted Ready Ready Preview, Comment Jun 22, 2026 1:36pm
studio-staging Ready Ready Preview, Comment Jun 22, 2026 1:36pm
ui-library Ready Ready Preview, Comment Jun 22, 2026 1:36pm
zone-www-dot-com Ready Ready Preview, Comment, Open in v0 Jun 22, 2026 1:36pm
1 Skipped Deployment
Project Deployment Actions Updated (UTC)
studio Ignored Ignored Jun 22, 2026 1:36pm

Request Review

@supabase

supabase Bot commented Jun 19, 2026

Copy link
Copy Markdown

This pull request has been ignored for the connected project xguihxuzqibwxjnimxev because there are no changes detected in supabase directory. You can change this behaviour in Project Integrations Settings ↗︎.


Preview Branches by Supabase.
Learn more about Supabase Branching ↗︎.

@coderabbitai

coderabbitai Bot commented Jun 19, 2026 •

Copy link
Copy Markdown
Contributor

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Repository UI (base), Organization UI (inherited)

Review profile: CHILL

Plan: Pro

Run ID: 02aa9f85-e0d6-4794-94d0-d85625d30110

📥 Commits

Reviewing files that changed from the base of the PR and between 8012444 and 85afd90.

📒 Files selected for processing (1)
  • e2e/studio/features/database.spec.ts

📝 Walkthrough

Walkthrough

Removes explicit waitForDatabaseToLoad and waitForSchemaVisualizerToLoad synchronization calls from the database e2e spec. The schema visualizer's public→auth switch now relies on focusTableInVisualizer auto-wait, and post-mutation list refresh validation depends solely on existing API response waiters. Import statements are updated accordingly.

Database E2E Synchronization

Layer / File(s) Summary
Import cleanup and synchronization changes
e2e/studio/features/database.spec.ts
Removes waitForDatabaseToLoad and waitForSchemaVisualizerToLoad imports. Replaces the explicit waitForSchemaVisualizerToLoad call (schema switch to auth) with focusTableInVisualizer auto-wait. Removes post-mutation waitForDatabaseToLoad calls after update and duplicate table operations, leaving only API response waiters.

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~3 minutes

Possibly related PRs

  • supabase/supabase#46402: Directly overlaps — both PRs modify the same database.spec.ts schema visualizer synchronization, switching between waitForDatabaseToLoad, waitForSchemaVisualizerToLoad, and focusTableInVisualizer wait strategies.
  • supabase/supabase#47077: Also modifies database.spec.ts to remove brittle schema-visualizer loading synchronization in favor of UI-driven gating via focusTableInVisualizer.

Suggested reviewers

  • awaseem
  • charislam

Poem

🐇 No more waiting in the hall,
For helpers that may never call.
The table finds itself in view,
The API waiter sees it through.
Less flake, more hop — that's my art!
A cleaner spec, a lighter heart. 🌿

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly identifies the main change: removing racy post-action waits in database E2E specs, which directly corresponds to the changeset's primary objective.
Description check ✅ Passed The description provides comprehensive context including the problem statement, specific changes made, test verification guidance, and references to related issues, though it deviates from the repository's template structure.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch alaister/e2e-database-race-fixes

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@github-actions

github-actions Bot commented Jun 19, 2026 •

Copy link
Copy Markdown
Contributor

🎭 Playwright Test Results

passed  218 passed
flaky  1 flaky
skipped  5 skipped

Details

stats  224 tests across 24 suites
duration  3 minutes, 27 seconds
commit  73ed0ac

Flaky tests

Features › realtime-inspector.spec.ts › Realtime Inspector › Basic Inspector UI › start/stop listening button works

Skipped tests

Features › auth-users.spec.ts › should show web3 users as enabled when the matching web3 provider is enabled
Features › sql-editor.spec.ts › SQL Editor › snippet favourite works as expected
Features › sql-editor.spec.ts › SQL Editor › share with team works as expected
Features › sql-editor.spec.ts › SQL Editor › folders works as expected
Features › sql-editor.spec.ts › SQL Editor › other SQL snippets actions work as expected

@awaseem
awaseem enabled auto-merge (squash) June 22, 2026 13:29
@awaseem
awaseem merged commit 2fdb59a into master Jun 22, 2026
31 checks passed
@awaseem
awaseem deleted the alaister/e2e-database-race-fixes branch June 22, 2026 13:37
matlin pushed a commit that referenced this pull request Jun 22, 2026
…46424) (#47106)

Follow-up to #47077, extracted from the TanStack Start migration
(#46424).

Three `waitForResponse` waits in `database.spec.ts` were registered
*after* their triggering action, so the response could resolve before
the listener attached and the wait would time out (this surfaced under
TanStack, where the data is SSR-streamed, but the waits are redundant on
Next too).

**Removed:**
- Schema Visualizer *actions*:
`waitForSchemaVisualizerToLoad(...'auth')` registered after the
schema-selector click — the `focusTableInVisualizer` loop immediately
below already auto-waits for the auth schema's tables.
- table update / duplicate: `waitForDatabaseToLoad(...)` after the save
mutation — the `toBeVisible` assertion right after each already waits
for the list to refetch.
- the now-unused `waitForDatabaseToLoad` /
`waitForSchemaVisualizerToLoad` imports.

The UI assertions are the real synchronization points, so behaviour is
unchanged on Next.

## To test
- Studio E2E `database.spec.ts` passes (the Schema Visualizer + Tables
groups).


<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->

## Summary by CodeRabbit

* **Tests**
* Improved database e2e test reliability by optimizing synchronization
logic and eliminating timing-sensitive helpers that could introduce
flakiness during schema and table operations.

<!-- end of auto-generated comment: release notes by coderabbit.ai -->

Co-authored-by: Alaister Young <[email protected]>
@alaister alaister mentioned this pull request Jul 10, 2026
6 tasks
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.

2 participants