test(memory): explain worker verify failures - #2172
Conversation
There was a problem hiding this comment.
LGTM: The instrumentation, always-uploaded artifact, async traps, tests, and spec row satisfy the unit without weakening existing guards.
Note
Approved · head af78d82 · no findings
Full review
No findings. The change satisfies the instrumentation-first contract and preserves existing guards.
Co-Authored-By: coreplane-switchboard[bot] <318072483+coreplane-switchboard[bot]@users.noreply.github.com>
af78d82 to
10135fb
Compare
There was a problem hiding this comment.
LGTM: The CodeQL finding is resolved by atomic temporary-directory creation, with no unresolved or new findings.
Note
Approved · head 10135fb · no findings
Full review
The prior CodeQL finding is resolved by atomic mkdtempSync directory creation; no findings remain.
There was a problem hiding this comment.
LGTM: The diagnostics, CI artifact upload, regression coverage, and spec update are consistent and no blocking issue remains.
Note
Approved · head 10135fb · no findings
Full review
No findings. The diagnostics, CI artifact upload, regression coverage, and spec update are consistent.
Memory Worker tests now record per-case timing, pool identity, unfinished work, and async escapes. CI always uploads the diagnostic table so the next failure identifies its source instead of a random victim.
Why: Issue #2119 kept timing out different tests after two real leaks were fixed, so another guessed fix would hide evidence. This instrumentation-first change distinguishes shared-pool contention from unfinished work without raising the timeout.
Where to look
Feedback wanted: Check whether task metadata survives every workerd failure mode and whether the table distinguishes serial-pool contention from unfinished operations.
Risk: This is 522 changed lines; splitting reporter, traps, and fixtures was considered, but CI upload and proof need to land atomically. A bad trap can false-fail only memory Worker tests; revert the commit to roll back.
Verified: Focused suites and scoped gates passed. Fresh CodeQL and memory Worker CI verify passed; the ten-main-run receipt remains human-gated.
Decisions (4)
Validation (11 criteria)
npx vitest run deploy/cloudflare-memory/backgroundTasks.test.ts src/ciWorkflow.test.ts src/memoryWorkerDiagnostics.test.ts→ 2 root files, 110 tests passed; exit 0.npm test -w deploy/cloudflare-memory -- backgroundTasks.test.ts→ 1 file, 1 test passed; diagnostic slowest line emitted; exit 0.NODE_OPTIONS=--max-old-space-size=6144 npx tsc --noEmit -p tsconfig.json→ exit 0.NODE_OPTIONS=--max-old-space-size=6144 npx tsc --noEmit -p deploy/cloudflare-memory/tsconfig.json→ exit 0.npx prettier --check <13 changed supported files>→ all matched files use Prettier code style; exit 0.npx eslint src/memoryWorkerDiagnostics.test.tspassed; CodeQL check 106541457918 completed successfully.npm run hygiene:check→ 9 files and 37 listed hits accepted; exit 0.npm run specs:check→ 51 specs and 5,661 proof references checked; exit 0.npm run specs:coverage -- --changed origin/main...HEAD --test-guard→ all paths covered; test-guard passed; exit 0.ci / workers / verify deploy/cloudflare-memorycheck 106541445542 completed successfully at pushed head.npm run check:pr-title -- "test(memory): explain worker verify failures"→ passed; exit 0.For agents
Rebased cleanly onto origin/main and force-pushed one coherent commit at 10135fb. The CodeQL review fix replaces predictable temp-path creation with atomic mkdtempSync; all four alerts originated from that helper, and the fresh CodeQL check passed. No leak or pool-isolation change is included: the first red artifact must decide that seam. The CI artifact is memory-test-diagnostics-${github.run_attempt}.
Requested by @justinhelmer in slack:C0BRRHKFLCB
🤖 Generated with Claude Code