fix(startup): scale the idle-silence timeout for CI, matching the absolute-max ceiling#22
Merged
Merged
Conversation
…olute-max ceiling DEFAULT_STARTUP_TIMEOUT_MS (the idle/no-output window) was still a flat 60s regardless of environment, while DEFAULT_STARTUP_MAX_MS (the absolute ceiling) already scales 120s -> 300s under CI. Under contended CI runners (e.g. several Harper instances booting concurrently within one sharded test process, each doing CPU/IO-heavy native module loads), a healthy boot can go quiet for more than 60s between debug-log lines without actually being hung, tripping the idle timer well under the (deliberately larger) absolute ceiling. Apply the same 2.5x ratio already used for DEFAULT_STARTUP_MAX_MS: 60s -> 150s under CI.
There was a problem hiding this comment.
Code Review
This pull request increases the default startup timeout (DEFAULT_STARTUP_TIMEOUT_MS) from 60 seconds to 150 seconds when running in a CI environment to prevent false-positive hang detections on contended runners. The documentation in README.md and the JSDoc comments in src/harperLifecycle.ts have been updated accordingly. There are no review comments, and I have no additional feedback to provide.
This was referenced Jul 16, 2026
kriszyp
marked this pull request as ready for review
July 16, 2026 01:45
github-actions Bot
pushed a commit
that referenced
this pull request
Jul 17, 2026
## [0.6.4](v0.6.3...v0.6.4) (2026-07-17) ### Bug Fixes * **startup:** scale the idle-silence timeout for CI, matching the absolute-max ceiling ([#22](#22)) ([ab75e40](ab75e40))
|
🎉 This PR is included in version 0.6.4 🎉 The release is available on: Your semantic-release bot 📦🚀 |
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
DEFAULT_STARTUP_TIMEOUT_MS(the idle/no-output watchdog windowrunHarperCommanduses to decide a boot has hung) was a flat 60s regardless of environment, whileDEFAULT_STARTUP_MAX_MS(the absolute ceiling) already scales 120s → 300s under CI (IS_CIcheck). Applies the same 2.5x ratio to the idle window: 60s → 150s under CI.Purpose
Closes the "and/or a higher CI-aware default" ask from #8, and the underlying cause of HarperFast/harper#1827 (recurring
HarperStartupError: Harper produced no startup output for 60000msacross unrelated PRs).Timeline that led here:
HARPER_INTEGRATION_TEST_STARTUP_TIMEOUT_MSenv overrides (120s Linux / 180s Windows), trusting the new idle-based design to handle contended CI runners without them.run.tsdefaults tofloor(availableParallelism()/2)+1concurrent processes) can still go quiet for >60s between debug-log lines without being hung, tripping the idle timer well under the deliberately-larger absolute ceiling. Hence "no startup output for 60000ms" showing up verbatim in the flake.Where to look
src/harperLifecycle.ts: theDEFAULT_STARTUP_TIMEOUT_MSdefault and its JSDoc, plus theStartHarperOptions.startupTimeoutMsJSDoc (caught by Codex review — was still documenting the old flat 60s).README.md: default value docs updated to match.No behavior change for non-CI runs; CI runs get 2.5x more idle headroom, consistent with the existing max-ceiling ratio. Not adding new test coverage for the
IS_CIbranch here — the siblingDEFAULT_STARTUP_MAX_MSCI branch has no coverage either and is already tracked as a follow-up in #10; happy to fold this new branch into that same issue instead of inventing a one-off pattern for it now.🤖 Generated by Claude (Sonnet 5), reviewed via
codex exec review --uncommitted(one non-blocking JSDoc nit found and fixed).