Skip to content

Isolate SqlMessageStorage tests with per-test table prefixes#6440

Open
sbking wants to merge 1 commit into
Effect-TS:mainfrom
sbking:fix/cluster-storage-test-isolation
Open

Isolate SqlMessageStorage tests with per-test table prefixes#6440
sbking wants to merge 1 commit into
Effect-TS:mainfrom
sbking:fix/cluster-storage-test-isolation

Conversation

@sbking

@sbking sbking commented Jul 16, 2026

Copy link
Copy Markdown
Contributor

Summary

The SqlMessageStorage tests run concurrently, but each dialect currently shares one set of tables and five tests truncate them. Under load, one test can consume another test's messages or delete its rows.

  • give each test its own tables using SqlMessageStorage.layerWith({ prefix })
  • remove the shared truncate helper
  • keep the existing concurrent test scheduling

I considered serializing the file, but per-test prefixes preserve its concurrent scheduling and remove the shared state instead of relying on test order.

Testing

  • before the change, the focused suite failed 7-9 of 29 tests across four consecutive runs under load
  • after the change, it passed 29/29 across twelve consecutive runs
  • pnpm vitest run packages/platform-node/test/cluster/SqlMessageStorage.test.ts
  • pnpm check
  • pnpm lint

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

Labels

Projects

Status: Discussion Ongoing

Development

Successfully merging this pull request may close these issues.

2 participants