From 2a3ac6833a5eadfd41e2d36b537b3eb8dd324776 Mon Sep 17 00:00:00 2001 From: Alaister Young <10985857+alaister@users.noreply.github.com> Date: Sun, 17 May 2026 23:50:04 +0800 Subject: [PATCH] test(e2e/studio): suffix RLS smoke-test table name with parallel index The "warns on CREATE TABLE without RLS" spec used a fixed `pw_rls_smoke_test` table name. With 3 self-hosted workers in parallel, two workers can race: worker A's `dropTable` lands between worker B's "Run and enable RLS" click and worker B's verifying `pg_class` query, leaving `rows[0]?.relrowsecurity` as undefined and asserting `expect(undefined).toBe(true)`. Suffix the table with `test.info().parallelIndex`, matching the pattern used elsewhere in the suite for parallel-safe per-worker tables. --- e2e/studio/features/sql-editor.spec.ts | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/e2e/studio/features/sql-editor.spec.ts b/e2e/studio/features/sql-editor.spec.ts index dcd1d93394f..21a302d20a5 100644 --- a/e2e/studio/features/sql-editor.spec.ts +++ b/e2e/studio/features/sql-editor.spec.ts @@ -291,7 +291,11 @@ test.describe('SQL Editor', () => { }) test('warns on CREATE TABLE without RLS and "Run and enable RLS" enables it', async ({ ref }) => { - const tableName = 'pw_rls_smoke_test' + // Suffix with parallel worker index so parallel workers don't collide + // on the same table name — when they do, one worker's `dropTable` + // races another's "Run and enable RLS" and the post-action query + // sometimes finds the table missing. + const tableName = `pw_rls_smoke_test_${test.info().parallelIndex}` // Drop any leftover table from a previous failed run, and ensure cleanup // after the test regardless of pass/fail.