Repository navigation
test(impeccable): give hook-bridge children time to start before the timeout - #739
Merged
Merged
Conversation
…timeout The runner's timeout counts from spawn, so on a loaded host it could fire before a freshly started Node child registered its handler or wrote its pid file. Tests that need the child running use a 4 s timeout and assert the child got that far.
fro-bot
approved these changes
Oct 30, 2026
fro-bot
left a comment
Owner
There was a problem hiding this comment.
Verdict: PASS
Test-only change to .opencode/impeccable/hook-bridge.integration.test.ts. I read the diff and the surrounding helpers (waitUntil, readPid, expectProcessGone, trackedFile). I did not run the suite.
Blocking issues
None
Non-blocking concerns
- The affected tests now rely on the child starting inside 4 s, not 0.4–1 s. This is a better margin, but still a fixed wall-clock bound. If the flakes come back on a heavily loaded host, a startup-gated approach would be sturdier. For example, the fixture could signal readiness and the test could start the clock from that signal. The ready-file assertion in the grace-period test already does part of this.
waitUntil(line 120) does not throw on budget exhaustion. In the exited-child grandchild test, theexpect(existsSync(grandchildPidFile)).toBe(true)that follows it (line 445) is what fails, so the assertion is correct. It is also an easy line to delete as redundant later. The comment there already explains why it stays.- Suite runtime goes up by about 20 s (about 36 s to about 57 s), as the PR description says. Per-test
15_000budgets still cover the worst case of4000 + grace + 2000slack. If this file gets slower, consider a shared constant for the2000slack.
Missing tests
None. The change fixes test reliability only. It adds the ready-file check, which stops the grace-period test from passing or failing on a missing marker alone, and the pid-file wait. No production code or security boundary is touched. There are no dependency, workflow, or secret-handling changes.
Risk assessment (LOW)
Test-only change with no runtime, API, auth, or dependency impact. The worst outcome is slightly slower CI, and the timing bounds are derived from CHILD_STARTUP_TIMEOUT_MS so they stay consistent if it is tuned.
Run Summary
| Field | Value |
|---|---|
| Event | pull_request |
| Repository | fro-bot/dashboard |
| Run ID | 40984858305 |
| Cache | hit |
| Session | ses_e759e4ddaffeJl23tGE05y6a24 |
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.
The
createSpawnRunnertimeout starts counting at spawn. On a loaded host it could fire before a freshly started Node child had registered its SIGTERM handler or written its pid file. The grace-period test then failed on a missing marker, and the grandchild tests failed withENOENTon the pid file.Seven tests need their child to be running before the timeout fires. They now use a 4 s timeout (
CHILD_STARTUP_TIMEOUT_MS), and their elapsed bounds are derived from it. The grace-period test also checks that the child wrote a ready file, and the grandchild test waits for the pid file before reading it. Test files only.Measured on the file:
The file now takes about 57 s per run, up from about 36 s, because five tests wait out the 4 s timeout.