test: fix three flaky CI tests (3131 regex, zero-session trim, win32 fixture probe)
Merged
DE
11d ago+18+18+01234567890123456789-7-7-0123456789
Summary
Three tests that fail CI at random on code-yeongyu/senpi (first attempt fails, rerun on the same SHA passes). Test-only; no runtime change.
| Test | Root cause | Fix |
|---|---|---|
test/suite/regressions/3131-spent-account.test.ts | JSON.stringify of RPC history/entries contains ms timestamps and faux api ids; any containing the digits 429 matched /429|rate_limit_error/ | Match the raw payload markers (429 { / rate_limit_error) instead of bare digits |
test/rpc-host-zero-session-trim-real.test.ts | footprintBeforeMb is read at the trim, after two earlier closes; an ordinary GC in between may already have returned their pages, so before - after can be one session's worth (expected 103 >= 159.3) | Measure the record's footprintAfterMb from the observed peak (the final peak - after assertion is unchanged) |
test/rpc-host-ensure.test.ts (Windows) | Fixture setup (writeRegistration / writerRecord) called readProcessStartTime with the 1 s win32 default; on a loaded runner Get-CimInstance is killed (SIGTERM) and setup threw before the case ran | Read fixture writer identities with the 15 s unhurried probe production already uses for the same read |
Evidence (CI runs that failed, then passed on rerun)
- 3131: run 38189312672 attempt 1,
Test (coding-agent 3/3) - trim-real: run 38189256304 attempt 1,
Test (coding-agent 1/3) - rpc-host-ensure: runs 38110197122 and 38089949727 attempt 1,
RPC named pipes (Windows)-Command failed: powershell.exe ... Get-CimInstance ...withkilled: true, signal: 'SIGTERM'
Not included: the #3044 owner-lifetime flake (already fixed by 2cd89870f) and the Windows zip: command not found (covered by #3162).
Verification
node ../../scripts/run-tests.mjs vitest run test/suite/regressions/3131-spent-account.test.ts test/rpc-host-zero-session-trim-real.test.ts test/rpc-host-ensure.test.ts-> 3 files, 57 tests passedbiome checkon the changed files: clean;tsc --noEmit: no errors in changed files- Test-only diff, so no changes.md / CHANGELOG entry and no CLI QA
Summary by cubic
Fixes three CI tests that flake at random (first attempt fails, rerun on the same SHA passes). Test-only; no runtime change.
- The
#3131spent-account regression test now matches the raw429 {/rate_limit_errorpayload instead of bare digits, which serialized timestamps and fake API ids could contain. - The zero-session trim test measures the record's after-trim footprint from the observed peak instead of
footprintBeforeMb, which is read after two earlier closes and may already be reduced by an ordinary GC. - The Windows
rpc-host-ensurefixture setup now reads writer identities with the 15-second probe production already uses, soGet-CimInstanceis not killed on a loaded runner before the test runs.
Verified: all three test files pass (57 tests), and biome check and tsc --noEmit are clean on the changed files.