Repository navigation
perf(test): run the API unit coverage lane at four workers - #1480
Conversation
Run `test:coverage:unit` at `--parallel=4` instead of one isolated worker. Bun 1.4.3 carries oven-sh/bun#44581, which closed oven-sh/bun#37968: the `EEXIST: epoll_ctl` abort that lost whole files under in-process workers. The per-file stdio dup leak behind it is still there (oven-sh/bun#38008 is unmerged); what the release removed is the wrong-epoll release that turned the leak into a failure. Pinned to four cores on 1.4.3, the unit lane at four workers was 12 of 12 clean where it failed 4 of 10 before, and the coverage lane with its CI flags dropped from 65-69s to 19-20s per shard at four shards. Both widths split the 437 files identically and cover the same 61,807 lines. Coverable lines differ by 51 in the merged report, which moves line coverage 0.05pp, inside the QA verdict's 0.1pp epsilon. The lane stays one invocation, so it still writes one LCOV. The plain `test:unit` worker processes, the unisolated integration lane and the shard watchdog are unchanged: oven-sh/bun#39709 is still open. Record the measurements and the upstream state in the testing reference, and correct the comments that still described the fix as pending. Signed-off-by: Julio Polycarpo <julio@polycarpo.dev>
|
PR head: CI duration (wall clock, critical path, slowest jobs)CI DurationReport-only timing from the Actions jobs API; runner variance does not affect the gate.
Since previous PR run: 13m 36s → 12m 6s (🟢 ▼ -1m 30s) Five slowest head jobs
QA Gate — Coverage & QualityBase: ✅ No attention signals — collected metrics look healthy against base. LoC (code): ⚪ ▲ = 0 • Line coverage (all workspaces): 🟢 ▲ +0.03pp • Quick check: pass • Duplication: ⚪ ▲ = 0 • Bundle gzip: ⚪ ▲ = 0 • Locked deps: ⚪ ▲ = 0 • Tests passed: ⚪ ▲ = 0 Metric details (coverage, LoC, bundle, dependencies, tests, duplication, tooling)CoverageAPI/shared branches and statements are source-derived from LCOV line hits because Bun LCOV does not emit branch or statement records. Rust crates: line, function and region coverage from
Lines of CodeAuthored source: production and test files of every discovered component. Generated, fixture, config and docs lines are recorded in the envelope but not counted here.
Frontend Bundle
Dependencies
TestsSingle full-suite pass (unit + integration, from the coverage run).
Test lanesOne row per lane, deduplicated by test.
Code Duplication (jscpd)
Repo Tooling
|
Commits — 2 commitsBase
Full commit messages
|
There was a problem hiding this comment.
Stale comment
Verdict: no merge blockers. One-commit PR (
74f557a5) onperf/unit-coverage-parallel-workers→main. No prior reviews or threads.The load-bearing change is
apps/apitest:coverage:unit--parallel=1→--parallel=4. Plaintest:unitstays multi-process--parallel=1, integration stays unisolated, shard count and watchdog stay. Lane tests pin--parallel=4; the qualification guard now accepts any positive--parallelcount, which is the right split (width is not a coverage-set change). Docs and comments match Bun 1.4.3 / #44581 vs still-open #38008 leak and #39709 hang. This CI check suite is green (51 passed, 0 failed).P0 / P1: none.
P2: one comment in
scripts/lib/test-lanes.tsnow ties keeping integration unisolated to “unit lane soak at four workers.” That soak is this PR’s experiment, not the unblock for isolate on spawn-heavy integration (#39709 / #38008). Restore the original gate so a green coverage soak does not read as permission to isolate that lane.Watch the first few main-branch shard runs for
epoll_ctlor watchdog kills; revert the flag if either returns. Not blocking.Sent by Cursor Automation: Mango Ecosystem CodeReview
The api lane comment tied leaving integration unisolated to the unit lane soaking at four workers. Those are unrelated: the unit lane's width rests on oven-sh/bun#44581, while integration stays out of isolate mode because that machinery is what hangs the runner (oven-sh/bun#39709, still open) and its files are spawn-heavy. Restore the present tense and name the open issue as the gate. Signed-off-by: Julio Polycarpo <julio@polycarpo.dev>
There was a problem hiding this comment.
Verdict: no merge blockers. Head fa1d578 on perf/unit-coverage-parallel-workers → main (a39ca7e). CI check suite green (51 passed, 0 failed, 20 skipped).
Since last review: fa1d578 (docs) addresses the P2 on scripts/lib/test-lanes.ts. Integration stays unisolated while oven-sh/bun#39709 is open; the comment no longer keys that on unit-lane soak. Present tense restored. Thread marked fully addressed.
The load-bearing change is still apps/api test:coverage:unit --parallel=1 → --parallel=4. Plain test:unit stays multi-process --parallel=1, integration stays unisolated, shard count and watchdog stay. Lane tests pin --parallel=4; the qualification guard accepts any positive --parallel count (width is not a coverage-set change). Docs match Bun 1.4.3 / #44581 vs still-open #38008 leak and #39709 hang.
P0 / P1 / P2: none remaining.
Watch the first few main-branch shard runs for epoll_ctl or watchdog kills; revert the flag if either returns. Not blocking.
Sent by Cursor Automation: Mango Ecosystem CodeReview


Summary
Run API unit coverage at four isolated workers per CI shard now that Bun 1.4.3 has removed the known
epoll_ctlabort path. Keep onebun testinvocation and one LCOV per unit shard.Changes
apps/api'stest:coverage:unitto--parallel=4and pin it in the lane tests.Test Plan
bun run checkpassesbun run testpassesbun run buildpassesNew UI strings use
@mangostudio/shared/i18n(no hardcoded strings)Manually smoke-tested: login, chat creation, image generation
Reported local validation:
bun run check; root scripts, 3,517 passed and 13 skipped. Restoring--parallel=1makes both updated lane assertions fail on the expected worker flag.Current-head CI passed tooling/typecheck, all four coverage shards, frontend tests, build and automated smoke checks at
fa1d578. Full localbun run test,bun run buildand manual smoke were not run. No UI strings were added.Screenshots / GIFs
Not applicable.
Notes
1.4.3+c6da4a4d3, WSL2 pinned to four cores, 437 unit files, output redirected to a file: coverage shards took 65–69s at one worker and 19–20s at four. All four shards passed at each width with identical file partitions. The unsharded unit soak was 12/12 clean, with 5,380 passed per run.