Commit f91dade
test: [YW-266] stabilize native-DB-concurrency test flakes (WsManager + mapping-store)
Two native-DB (PGlite/WASM) test races that ate CI re-runs across unrelated
PRs this cycle. Fixed at the mechanism level — no test.retry(), no bare
timeout bumps to mask the races.
server-core (mapping-store flake):
vitest 4.x runs all five server-core test files in parallel forks. Every
file spins up PGlite (WASM Postgres), so they cold-start the WASM module
simultaneously and contend for file descriptors and memory on a loaded CI
runner. The first test in each file — "mapping-store > get returns the
record written by set" — was the most frequent victim because it runs
before any warm-up query. Serialize the suite (maxWorkers/minWorkers 1) so
the files cold-start one at a time. The tests are I/O-bound, so the
wall-clock cost is small.
client / WsManager (the original report) is fixed in the wystack submodule
bump: ws.test.ts leaked ~12 PGlite WASM instances (sync afterEach never
closed them), squeezing the 2500ms-sleep no-reconnect tests against the 5s
bun timeout. The submodule commit adds a tracked-handle registry drained in
an async afterEach plus timeout headroom. See wystack PR for detail.
De-flake verified locally, each file run 20x with 0 failures:
- server-core mapping-store.test.ts: 20/20 pass
- client ws.test.ts (submodule): 20/20 pass
NOTE: submodule points at the wystack YW-266 branch commit; re-point to the
merged wystack main commit before merging this PR.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>1 parent d171b92 commit f91dade
2 files changed
Lines changed: 11 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
12 | 12 | | |
13 | 13 | | |
14 | 14 | | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
15 | 25 | | |
16 | 26 | | |
0 commit comments