test(ep0f): registry hermetic classifier mock + logger timeout diagnostics (kata ep0f) - #675
Merged
Conversation
…2 pid lifecycle, M3 honest test typecheck, M4 observable PROBE-FATAL GREEN, m1 backend truth, m2 waitFor wording)
…check claim, rename misleading test name, PROBE-FATAL via sync fd write + reachable observability)
…n focused loops, rename-surviving -t selector, per-test captured output, narrowed success criterion 5); plan loop ends at cap FAILED/non-converged
… kills real 12.5GB-DB worker spawn inside vi.waitFor 1s window (kata ep0f)
…ed, runtime pin=engines≥22.5)
…utput on content-wait timeouts (kata ep0f; re-applied onto #674's durable-receipt version)
…l durable receipt); branch rebased onto it
danshapiro
force-pushed
the
the-usual/ep0f-deflake
branch
from
August 22, 2026 07:21
9df7dad to
f914a01
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Root-cause fixes for two of the five
test-hygieneload-flake families tracked as kata ep0f's timing-pin class (observed under host load 54–94 across four full-suite executions during the rust-sidecar-sdk-0-3 gate campaign). Test-files only; zero production changes.logger.separation — exit-before-flush race
The three tsx
-eprobes endedsetTimeout(() => process.exit(0), 25|50), which races rotating-file-stream's lazy open + async first write. Measured under induced load ~90: logger.ts import takes 368ms; its 'Resolved debug log path' record lands at 390ms — a ~15× overshoot of the 25ms exit window; historical passes survived on ~3ms of luck. On a miss the record can never land, andwaitForFileContenttreats empty as not-yet, burning its full 30s gate on an impossible condition.resolveDebugLogPath()target andprocess.exit(0)only once their expected content is on disk (cap 10s;PROBE-FATALvia synchronousfs.writeFileSync(2, …)+exit(1)otherwise).waitForFileContenttimeout errors now include the logDir listing with per-file sizes and the probes' captured stdout/stderr.exitCode === 0and absence ofPROBE-FATALafter content waits; the multi-probe waits run concurrently.terminal-registry :3317 — real worker spawn + 12.5 GB DB inside a 1s window
vi.waitFor's default budget (interval 50ms / timeout 1000ms, Vitest 3.2.4) wrapped a REAL fire-and-forget classification: nestednode:worker_threadsspawn opening the host's 12.5 GBopencode.db. Measured 222ms idle / 638ms loaded (single-shot) against the 1000ms cap. CI containers lack the DB + fast path, so the flake was dev-host specific.vi.mock('../../../server/coding-cli/providers/opencode-subagent-query.js')mirroring the two sibling test files;mockResolvedValue(false)in a describe-localbeforeEach(the outer describe'svi.resetAllMocks()wipes factory-set implementations — the trap is documented in the test).terminal-registry.rebind-metadata-resync.test.ts; real classifier coverage inopencode-subagent-query.test.ts).bind-reclassify-guard.test.tsreworded to match.Verification
42085e4b8; the three later commits are plan-doc-only.FRESHELL_LOG_DIR→ infinite rfsmkdirretry starving the event loop) — found via strace while generating receipts, explicitly out of scope here.test/**today.Review journey (the-usual-beta)
.worktrees/.the-usual-logs/ep0f-deflake/recap.md.Kata ep0f stays open for the three remaining families (remote-proxy, opencode-serve-manager, codex-session-flow).