Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ The Harper binary is resolved in the following order:

```ts
interface StartHarperOptions {
startupTimeoutMs?: number; // Idle timeout: max gap between startup output chunks. Default: 60000 or HARPER_INTEGRATION_TEST_STARTUP_TIMEOUT_MS
startupTimeoutMs?: number; // Idle timeout: max gap between startup output chunks. Default: 60000 (150000 under CI) or HARPER_INTEGRATION_TEST_STARTUP_TIMEOUT_MS
startupMaxMs?: number; // Absolute startup ceiling regardless of output. Default: 120000 (300000 under CI) or HARPER_INTEGRATION_TEST_STARTUP_MAX_MS
config?: object; // Harper config overrides (passed via HARPER_SET_CONFIG)
env?: object; // Additional environment variables for the Harper process
Expand All @@ -110,7 +110,7 @@ Startup readiness is detected by Harper printing `successfully started`. Rather

**Environment Variables:**

- `HARPER_INTEGRATION_TEST_STARTUP_TIMEOUT_MS` - Idle startup timeout: max time between chunks of startup output before Harper is treated as hung (resets on output). Default `60000`.
- `HARPER_INTEGRATION_TEST_STARTUP_TIMEOUT_MS` - Idle startup timeout: max time between chunks of startup output before Harper is treated as hung (resets on output). Default `60000` (`150000` under CI).
- `HARPER_INTEGRATION_TEST_STARTUP_MAX_MS` - Absolute ceiling on total startup time, regardless of ongoing output. Default `120000` (`300000` under CI).
- `HARPER_INTEGRATION_TEST_INSTALL_PARENT_DIR` - Parent directory for temp Harper install dirs (default: OS tmpdir)
- `HARPER_INTEGRATION_TEST_INSTALL_SCRIPT` - Path to Harper CLI script
Expand Down
12 changes: 8 additions & 4 deletions src/harperLifecycle.ts
Original file line number Diff line number Diff line change
Expand Up @@ -59,11 +59,15 @@ const IS_CI = !!process.env.CI;
* Maximum time to wait between chunks of Harper startup output before treating the process
* as hung. The startup watchdog resets this window on every chunk of output, so the limit is
* time-since-last-progress rather than total boot time: a slow-but-healthy boot that keeps
* logging never trips it — only true silence does.
* logging never trips it — only true silence does. Higher under CI, matching
* {@link DEFAULT_STARTUP_MAX_MS}'s CI scaling — shared/contended runners can go quiet between
* log lines for longer without actually being hung (e.g. native module load/RocksDB open
* competing with sibling concurrently-booting Harper instances for CPU).
*
* Override with `HARPER_INTEGRATION_TEST_STARTUP_TIMEOUT_MS`. Default 60s.
* Override with `HARPER_INTEGRATION_TEST_STARTUP_TIMEOUT_MS`. Default 60s (150s under CI).
*/
export const DEFAULT_STARTUP_TIMEOUT_MS = parseInt(process.env.HARPER_INTEGRATION_TEST_STARTUP_TIMEOUT_MS || '', 10) || 60000;
export const DEFAULT_STARTUP_TIMEOUT_MS =
parseInt(process.env.HARPER_INTEGRATION_TEST_STARTUP_TIMEOUT_MS || '', 10) || (IS_CI ? 150000 : 60000);

/**
* Absolute ceiling on total startup time, regardless of ongoing output — a generous backstop
Expand Down Expand Up @@ -117,7 +121,7 @@ export interface StartHarperOptions {
/**
* Maximum time (ms) to wait between chunks of startup output before treating Harper as hung.
* Resets on every chunk of output, so it bounds silence, not total boot time.
* Falls back to {@link DEFAULT_STARTUP_TIMEOUT_MS} (60s).
* Falls back to {@link DEFAULT_STARTUP_TIMEOUT_MS} (60s locally, 150s under CI).
*/
startupTimeoutMs?: number;
/**
Expand Down