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.
This commit is contained in:
Alaister Young committed 2026-05-17 23:50:04 +08:00
1 parent 0bd9f1bb2d
commit 2a3ac6833a
1 file changed
+5 -1
+5 -1
View File
@@ -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.