Skip to content

Commit 93ed0c4

Browse files
committed
test: serialize external db sync tests via forks pool
1 parent 76f9de5 commit 93ed0c4

2 files changed

Lines changed: 16 additions & 0 deletions

File tree

apps/e2e/vitest.config.ts

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,19 @@ export default mergeConfig(
1414
"./tests/setup.ts",
1515
],
1616
snapshotSerializers: ["./tests/snapshot-serializer.ts"],
17+
poolMatchGlobs: [
18+
['**/tests/backend/endpoints/api/v1/external-db-sync*.test.ts', 'forks'],
19+
],
20+
poolOptions: {
21+
forks: {
22+
maxForks: 1,
23+
minForks: 1,
24+
},
25+
threads: {
26+
maxThreads: 8,
27+
minThreads: 1,
28+
},
29+
},
1730
},
1831
}),
1932
)

claude/CLAUDE-KNOWLEDGE.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,3 +11,6 @@ A: The generated `.next/types/validator.ts` can keep stale imports for removed r
1111

1212
Q: Why can external DB sync tests time out in dev-focused GitHub workflows?
1313
A: The first calls to `/api/latest/internal/external-db-sync/sequencer` and `/poller` can be slow in dev mode and hit Undici's headers timeout; prewarming those endpoints with the cron secret, retrying header-timeout failures in the test helper, or running tests single-worker are viable mitigations.
14+
15+
Q: How can we serialize only the external DB sync Vitest files while keeping the rest parallel?
16+
A: Use `poolMatchGlobs` to route the external DB sync test globs to the `forks` pool and set `poolOptions.forks.{minForks,maxForks}=1` in `apps/e2e/vitest.config.ts`; keep the default threads pool for all other tests.

0 commit comments

Comments
 (0)