fix(cli): configurable dev readiness timeout; de-flake child-disposal test#287
Conversation
… test Under CI load the dev child's tsx boot could exceed the parent's hard-coded 5s /healthz readiness window, so the parent killed a child that had not yet written its PID file and the disposal test timed out on waitForPath. Add DAWN_DEV_READY_TIMEOUT_MS (mirroring DAWN_DEV_SHUTDOWN_TIMEOUT_MS), widen the window in the test, and raise the waitForPath default. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
Claude finished @blove's task in 2m 7s —— View job Code Review
The fix is clean and the implementation is correct. A few observations:
Exact mirror of Test timing (dev-command.test.ts:208–236) The test now sets a 15 s health window and already carries a One ordering observation: the test does const exitCode = await dev.waitForExit() // blocks until parent exits (~15 s)
await waitForPath(pidPath) // then polls for PID fileThe child writes its PID before signalling ready, and the parent only exits after the health-check window expires, so by the time If you want to make the intent clearer (and potentially catch a future flake earlier), swapping the order would be more direct: await waitForPath(pidPath) // confirm child actually started
const exitCode = await dev.waitForExit() // then wait for parent to clean upNot a blocking issue — either order works once the PID file exists.
The 2 s → 10 s change affects three call sites (lines 229, 402, 574). Lines 402 and 574 wait for marker files in tests with active running servers. Widening the default means those tests would tolerate a 10 s delay silently before failing. Under normal conditions marker files appear in < 100 ms, so this won't hide real bugs in practice, but it's worth being aware that the sentinel change is global, not scoped to just the flaky test. Overall The implementation is correct, follows the established Looks good to merge. |
|
Claude finished @blove's task in 1m 2s —— View job Code Review
The implementation is correct and follows the established
Exact mirror of
Test ordering (dev-command.test.ts:228–229) const exitCode = await dev.waitForExit() // blocks ~15s
await waitForPath(pidPath) // polls for PID fileThe child writes its PID before reporting ready, so the file exists well before await waitForPath(pidPath) // confirm child started
const exitCode = await dev.waitForExit() // then wait for parent cleanupNot a blocking issue — either order works today. Fix this →
The 2s → 10s change is global and affects all three call sites (lines 229, 402, 574). For the flaky test, this is meaningful. For the other two sites (active running servers), marker files arrive in <100ms in practice, so the wider window won't mask real bugs — just adds a longer silent wait on genuine failures. Acceptable trade-off for the defensive buffer. Changeset Correctly scoped as Overall: The PR is correct and the approach is sound. The honest caveat in the description (flake mechanism not fully pinned) is appreciated — the |
Summary
The
dev-commanddisposal test ("disposes a newly spawned child when startup readiness fails") flaked repeatedly in CI (Timed out waiting for path /tmp/dawn-dev-child-pid-*.txt), blocking merges on #259/#263/#275.DAWN_DEV_READY_TIMEOUT_MS— the parent's/healthzreadiness window (was hard-coded 5s inwaitForDevServerReady's sole call site). Mirrors the existingDAWN_DEV_SHUTDOWN_TIMEOUT_MSpattern; default unchanged.waitForPathdefault goes 2s → 10s.Honest caveat: the precise flake mechanism isn't 100% pinned — the child writes its PID before reporting ready, and the parent has no pre-ready timeout, so the timing of the observed 7s failure doesn't fully close. This PR widens both timing windows around the observed failure and adds the knob; if the flake recurs, next step is instrumenting the child's pre-ready exit stderr (
DevChildStartupError).Test Plan
test/dev-command.test.tsrun 4× sequentially: 16/16 each, no flakestypecheck+lintclean@dawn-ai/clipatch)🤖 Generated with Claude Code