@harperfast/integration-testing 0.4.0 → 0.5.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +20 -5
- package/dist/harperLifecycle.d.ts +84 -4
- package/dist/harperLifecycle.js +246 -34
- package/dist/harperLifecycle.js.map +1 -1
- package/dist/loopbackAddressPool.d.ts +3 -3
- package/dist/loopbackAddressPool.js +26 -15
- package/dist/loopbackAddressPool.js.map +1 -1
- package/dist/portUtils.d.ts +26 -0
- package/dist/portUtils.js +47 -0
- package/dist/portUtils.js.map +1 -0
- package/dist/run.js +0 -0
- package/package.json +4 -3
- package/dist/security/certGenUtils.d.ts +0 -52
- package/dist/security/certGenUtils.js +0 -170
- package/dist/security/certGenUtils.js.map +0 -1
- package/dist/security/crl/generate-test-certs.d.ts +0 -34
- package/dist/security/crl/generate-test-certs.js +0 -81
- package/dist/security/crl/generate-test-certs.js.map +0 -1
- package/dist/security/ocsp/generate-test-certs.d.ts +0 -55
- package/dist/security/ocsp/generate-test-certs.js +0 -106
- package/dist/security/ocsp/generate-test-certs.js.map +0 -1
- package/dist/security/ocspServer.d.ts +0 -18
- package/dist/security/ocspServer.js +0 -132
- package/dist/security/ocspServer.js.map +0 -1
- package/dist/securityServices.d.ts +0 -49
- package/dist/securityServices.js +0 -120
- package/dist/securityServices.js.map +0 -1
- package/dist/src/harperLifecycle.d.ts +0 -156
- package/dist/src/harperLifecycle.js +0 -315
- package/dist/src/harperLifecycle.js.map +0 -1
- package/dist/src/index.d.ts +0 -3
- package/dist/src/index.js +0 -4
- package/dist/src/index.js.map +0 -1
- package/dist/src/loopbackAddressPool.d.ts +0 -50
- package/dist/src/loopbackAddressPool.js +0 -337
- package/dist/src/loopbackAddressPool.js.map +0 -1
- package/dist/src/run.d.ts +0 -2
- package/dist/src/run.js +0 -94
- package/dist/src/run.js.map +0 -1
- package/dist/src/security/certGenUtils.d.ts +0 -52
- package/dist/src/security/certGenUtils.js +0 -170
- package/dist/src/security/certGenUtils.js.map +0 -1
- package/dist/src/security/crl/generate-test-certs.d.ts +0 -34
- package/dist/src/security/crl/generate-test-certs.js +0 -81
- package/dist/src/security/crl/generate-test-certs.js.map +0 -1
- package/dist/src/security/ocsp/generate-test-certs.d.ts +0 -55
- package/dist/src/security/ocsp/generate-test-certs.js +0 -106
- package/dist/src/security/ocsp/generate-test-certs.js.map +0 -1
- package/dist/src/security/ocspServer.d.ts +0 -18
- package/dist/src/security/ocspServer.js +0 -132
- package/dist/src/security/ocspServer.js.map +0 -1
- package/dist/src/securityServices.d.ts +0 -49
- package/dist/src/securityServices.js +0 -120
- package/dist/src/securityServices.js.map +0 -1
- package/dist/src/targz.d.ts +0 -6
- package/dist/src/targz.js +0 -20
- package/dist/src/targz.js.map +0 -1
package/README.md
CHANGED
|
@@ -68,16 +68,22 @@ The Harper binary is resolved in the following order:
|
|
|
68
68
|
|
|
69
69
|
```ts
|
|
70
70
|
interface StartHarperOptions {
|
|
71
|
-
startupTimeoutMs?: number; // Default:
|
|
71
|
+
startupTimeoutMs?: number; // Idle timeout: max gap between startup output chunks. Default: 60000 or HARPER_INTEGRATION_TEST_STARTUP_TIMEOUT_MS
|
|
72
|
+
startupMaxMs?: number; // Absolute startup ceiling regardless of output. Default: 120000 (300000 under CI) or HARPER_INTEGRATION_TEST_STARTUP_MAX_MS
|
|
72
73
|
config?: object; // Harper config overrides (passed via HARPER_SET_CONFIG)
|
|
73
74
|
env?: object; // Additional environment variables for the Harper process
|
|
74
75
|
harperBinPath?: string; // Explicit path to dist/bin/harper.js
|
|
75
76
|
}
|
|
76
77
|
```
|
|
77
78
|
|
|
79
|
+
Startup readiness is detected by Harper printing `successfully started`. Rather than a single wall-clock deadline (which makes a slow-but-healthy boot indistinguishable from a hang), the watchdog uses an **idle timeout** that resets on every chunk of output — so the limit is time-since-last-progress — plus a generous absolute ceiling as a backstop. This is why a slow CI boot that keeps logging no longer trips the timeout.
|
|
80
|
+
|
|
81
|
+
> **Behavior change:** `startupTimeoutMs` (and `HARPER_INTEGRATION_TEST_STARTUP_TIMEOUT_MS`) previously meant an absolute startup deadline. It now means the **idle / no-output window**. If you relied on it as a hard ceiling to fail slow boots quickly, set `startupMaxMs` (or `HARPER_INTEGRATION_TEST_STARTUP_MAX_MS`) instead.
|
|
82
|
+
|
|
78
83
|
**Environment Variables:**
|
|
79
84
|
|
|
80
|
-
- `HARPER_INTEGRATION_TEST_STARTUP_TIMEOUT_MS` -
|
|
85
|
+
- `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`.
|
|
86
|
+
- `HARPER_INTEGRATION_TEST_STARTUP_MAX_MS` - Absolute ceiling on total startup time, regardless of ongoing output. Default `120000` (`300000` under CI).
|
|
81
87
|
- `HARPER_INTEGRATION_TEST_INSTALL_PARENT_DIR` - Parent directory for temp Harper install dirs (default: OS tmpdir)
|
|
82
88
|
- `HARPER_INTEGRATION_TEST_INSTALL_SCRIPT` - Path to Harper CLI script
|
|
83
89
|
|
|
@@ -85,13 +91,22 @@ interface StartHarperOptions {
|
|
|
85
91
|
|
|
86
92
|
Like `startHarper()`, but copies a component directory into the Harper install before starting, so it's available on first boot without a deploy.
|
|
87
93
|
|
|
88
|
-
### `killHarper(ctx)`
|
|
94
|
+
### `killHarper(ctx, options?)`
|
|
89
95
|
|
|
90
|
-
|
|
96
|
+
Terminates Harper's whole process tree and waits for it to exit. It sends SIGTERM first, giving Harper a grace period to shut down cleanly (flush RocksDB, release ports, reap workers) before escalating to SIGKILL, then waits briefly for the actual exit. Because Harper is spawned as its own process group (`detached` on POSIX), the signal targets the group — parent and any child processes — rather than only the direct child; on Windows it uses `taskkill /T`. A dead process releases its listening sockets, so once `killHarper` returns the fixed ports are free. Does not release the loopback address or clean up the install directory. Useful for restart scenarios where the test will call `startHarper` again.
|
|
97
|
+
|
|
98
|
+
`options.graceMs` overrides the SIGTERM→SIGKILL grace period (default `5000`, or `HARPER_INTEGRATION_TEST_TEARDOWN_GRACE_MS`).
|
|
91
99
|
|
|
92
100
|
### `teardownHarper(ctx)`
|
|
93
101
|
|
|
94
|
-
Kills Harper, releases the loopback address back to the pool, and removes the install directory. Call in a teardown/`after()` hook.
|
|
102
|
+
Kills Harper's process tree, releases the loopback address back to the pool, and removes the install directory. Call in a teardown/`after()` hook.
|
|
103
|
+
|
|
104
|
+
Since `killHarper` waits for the process tree to exit, its fixed ports (Operations API, HTTP/S, MQTT/S) are already released by the time the address is recycled. As a safety assertion, teardown still verifies those ports are free before recycling — the pool only guarantees the *address* is bindable, not that these specific ports are free — and logs a warning if any are somehow still held (a sign a Harper child process escaped the kill). The address is recycled regardless.
|
|
105
|
+
|
|
106
|
+
**Environment Variables:**
|
|
107
|
+
|
|
108
|
+
- `HARPER_INTEGRATION_TEST_TEARDOWN_GRACE_MS` - Grace period after SIGTERM before escalating to SIGKILL. Default `5000`.
|
|
109
|
+
- `HARPER_INTEGRATION_TEST_PORT_RELEASE_TIMEOUT_MS` - Max time teardown's safety assertion waits for Harper's ports to be free before recycling the loopback address (normally instant, since the process tree is already dead). Default `5000`.
|
|
95
110
|
|
|
96
111
|
### `sendOperation(context, operation)`
|
|
97
112
|
|
|
@@ -29,7 +29,40 @@ export declare function createHarperContext(name?: string): HarperTestContext;
|
|
|
29
29
|
export declare const OPERATIONS_API_PORT = 9925;
|
|
30
30
|
export declare const DEFAULT_ADMIN_USERNAME = "admin";
|
|
31
31
|
export declare const DEFAULT_ADMIN_PASSWORD = "Abc1234!";
|
|
32
|
+
/**
|
|
33
|
+
* Maximum time to wait between chunks of Harper startup output before treating the process
|
|
34
|
+
* as hung. The startup watchdog resets this window on every chunk of output, so the limit is
|
|
35
|
+
* time-since-last-progress rather than total boot time: a slow-but-healthy boot that keeps
|
|
36
|
+
* logging never trips it — only true silence does.
|
|
37
|
+
*
|
|
38
|
+
* Override with `HARPER_INTEGRATION_TEST_STARTUP_TIMEOUT_MS`. Default 60s.
|
|
39
|
+
*/
|
|
32
40
|
export declare const DEFAULT_STARTUP_TIMEOUT_MS: number;
|
|
41
|
+
/**
|
|
42
|
+
* Absolute ceiling on total startup time, regardless of ongoing output — a generous backstop
|
|
43
|
+
* so a process that chatters forever without ever reporting ready still fails. Higher under CI,
|
|
44
|
+
* where shared/contended runners boot more slowly.
|
|
45
|
+
*
|
|
46
|
+
* Override with `HARPER_INTEGRATION_TEST_STARTUP_MAX_MS`. Default 120s (300s under CI).
|
|
47
|
+
*/
|
|
48
|
+
export declare const DEFAULT_STARTUP_MAX_MS: number;
|
|
49
|
+
/**
|
|
50
|
+
* Grace period after SIGTERM before escalating to SIGKILL during teardown, giving Harper time
|
|
51
|
+
* to shut down cleanly (flush RocksDB, release ports, reap worker children).
|
|
52
|
+
*
|
|
53
|
+
* Override with `HARPER_INTEGRATION_TEST_TEARDOWN_GRACE_MS`. Default 5s.
|
|
54
|
+
*/
|
|
55
|
+
export declare const DEFAULT_TEARDOWN_GRACE_MS: number;
|
|
56
|
+
/**
|
|
57
|
+
* Time teardown's safety assertion waits for Harper's fixed ports to be free before recycling the
|
|
58
|
+
* loopback address. Killing Harper's process tree (and waiting for exit) should free them
|
|
59
|
+
* immediately, so this normally returns on the first check; it only matters if a child process
|
|
60
|
+
* escaped the kill. If the ports are still in use at the deadline, the address is recycled anyway
|
|
61
|
+
* (no worse than not waiting) and a warning is logged.
|
|
62
|
+
*
|
|
63
|
+
* Override with `HARPER_INTEGRATION_TEST_PORT_RELEASE_TIMEOUT_MS`. Default 5s.
|
|
64
|
+
*/
|
|
65
|
+
export declare const DEFAULT_PORT_RELEASE_TIMEOUT_MS: number;
|
|
33
66
|
/**
|
|
34
67
|
* The runtime to use for running Harper during tests.
|
|
35
68
|
* Set via the HARPER_RUNTIME environment variable ('node' or 'bun').
|
|
@@ -47,10 +80,16 @@ export declare const LOG_DIR_MARKER_PREFIX = "[Harper] Logs for this instance wi
|
|
|
47
80
|
*/
|
|
48
81
|
export interface StartHarperOptions {
|
|
49
82
|
/**
|
|
50
|
-
*
|
|
51
|
-
*
|
|
83
|
+
* Maximum time (ms) to wait between chunks of startup output before treating Harper as hung.
|
|
84
|
+
* Resets on every chunk of output, so it bounds silence, not total boot time.
|
|
85
|
+
* Falls back to {@link DEFAULT_STARTUP_TIMEOUT_MS} (60s).
|
|
52
86
|
*/
|
|
53
87
|
startupTimeoutMs?: number;
|
|
88
|
+
/**
|
|
89
|
+
* Absolute ceiling (ms) on total startup time, regardless of ongoing output.
|
|
90
|
+
* Falls back to {@link DEFAULT_STARTUP_MAX_MS} (120s locally, 300s under CI).
|
|
91
|
+
*/
|
|
92
|
+
startupMaxMs?: number;
|
|
54
93
|
/**
|
|
55
94
|
* Additional configuration options to pass to the Harper CLI.
|
|
56
95
|
*/
|
|
@@ -115,6 +154,36 @@ export declare class HarperStartupError extends Error {
|
|
|
115
154
|
stderr: string;
|
|
116
155
|
constructor(message: string, stdout: string, stderr: string);
|
|
117
156
|
}
|
|
157
|
+
interface RunHarperCommandOptions {
|
|
158
|
+
args: string[];
|
|
159
|
+
env: any;
|
|
160
|
+
completionMessage?: string;
|
|
161
|
+
/** When set, stdout and stderr are written to files in this directory */
|
|
162
|
+
logDir?: string;
|
|
163
|
+
harperBinPath?: string;
|
|
164
|
+
/** Idle timeout (ms): max time between output chunks before treating the process as hung. Resets on output. Falls back to DEFAULT_STARTUP_TIMEOUT_MS. */
|
|
165
|
+
timeoutMs?: number;
|
|
166
|
+
/** Absolute timeout (ms): ceiling on total time regardless of output. Falls back to DEFAULT_STARTUP_MAX_MS. */
|
|
167
|
+
maxMs?: number;
|
|
168
|
+
}
|
|
169
|
+
interface RunHarperCommandResult {
|
|
170
|
+
process: ChildProcess;
|
|
171
|
+
/** Captured stdout up to the point the process was considered ready or exited. */
|
|
172
|
+
stdout: string;
|
|
173
|
+
/** Captured stderr up to the point the process was considered ready or exited. */
|
|
174
|
+
stderr: string;
|
|
175
|
+
}
|
|
176
|
+
/**
|
|
177
|
+
* Runs a Harper CLI command and captures output.
|
|
178
|
+
*
|
|
179
|
+
* When `logDir` is provided, stdout and stderr are also written to files
|
|
180
|
+
* (`stdout.log` and `stderr.log`) in that directory.
|
|
181
|
+
*
|
|
182
|
+
* @throws {HarperStartupError} If the command times out or exits with a non-zero status code
|
|
183
|
+
*
|
|
184
|
+
* Exported for unit testing; not part of the public API (not re-exported from `index.ts`).
|
|
185
|
+
*/
|
|
186
|
+
export declare function runHarperCommand({ args, env, completionMessage, logDir, harperBinPath, timeoutMs, maxMs, }: RunHarperCommandOptions): Promise<RunHarperCommandResult>;
|
|
118
187
|
/**
|
|
119
188
|
* Sets up a Harper instance with a component pre-installed from a local directory.
|
|
120
189
|
*
|
|
@@ -154,10 +223,20 @@ export declare function setupHarperWithFixture(ctx: HarperTestContext, fixturePa
|
|
|
154
223
|
*/
|
|
155
224
|
export declare function startHarper(ctx: HarperTestContext, options?: StartHarperOptions): Promise<StartedHarperTestContext>;
|
|
156
225
|
/**
|
|
157
|
-
* Kill harper process (can be used for teardown, or killing it before a restart)
|
|
226
|
+
* Kill harper process (can be used for teardown, or killing it before a restart).
|
|
227
|
+
*
|
|
228
|
+
* Sends SIGTERM to Harper's whole process tree first and gives it a grace period to shut down
|
|
229
|
+
* cleanly (flush RocksDB, release ports, reap worker children) before escalating to SIGKILL.
|
|
230
|
+
* After SIGKILL it waits briefly for the process to actually exit, so callers can rely on it
|
|
231
|
+
* being gone — and, since a dead process releases its listening sockets, on its ports being free.
|
|
232
|
+
*
|
|
158
233
|
* @param ctx
|
|
234
|
+
* @param options.graceMs Time to wait after SIGTERM before sending SIGKILL. Defaults to
|
|
235
|
+
* {@link DEFAULT_TEARDOWN_GRACE_MS}.
|
|
159
236
|
*/
|
|
160
|
-
export declare function killHarper(ctx: StartedHarperTestContext
|
|
237
|
+
export declare function killHarper(ctx: StartedHarperTestContext, options?: {
|
|
238
|
+
graceMs?: number;
|
|
239
|
+
}): Promise<void>;
|
|
161
240
|
/**
|
|
162
241
|
* Tears down a Harper instance and cleans up all resources.
|
|
163
242
|
*
|
|
@@ -180,3 +259,4 @@ export declare function killHarper(ctx: StartedHarperTestContext): Promise<void>
|
|
|
180
259
|
*/
|
|
181
260
|
export declare function teardownHarper(ctx: StartedHarperTestContext): Promise<void>;
|
|
182
261
|
export declare function sendOperation(context: HarperContext, operation: any): Promise<any>;
|
|
262
|
+
export {};
|
package/dist/harperLifecycle.js
CHANGED
|
@@ -5,6 +5,7 @@ import { tmpdir } from 'node:os';
|
|
|
5
5
|
import { mkdtemp, mkdir, rm, cp } from 'node:fs/promises';
|
|
6
6
|
import {} from 'node:test';
|
|
7
7
|
import { getNextAvailableLoopbackAddress, releaseLoopbackAddress } from "./loopbackAddressPool.js";
|
|
8
|
+
import { waitForPortsFree } from "./portUtils.js";
|
|
8
9
|
import { ok, equal } from 'node:assert';
|
|
9
10
|
import { createRequire } from 'node:module';
|
|
10
11
|
/**
|
|
@@ -24,7 +25,46 @@ const MQTTS_PORT = 8883;
|
|
|
24
25
|
export const OPERATIONS_API_PORT = 9925;
|
|
25
26
|
export const DEFAULT_ADMIN_USERNAME = 'admin';
|
|
26
27
|
export const DEFAULT_ADMIN_PASSWORD = 'Abc1234!';
|
|
28
|
+
/** Every fixed port a Harper test instance may bind, all on its assigned loopback address. */
|
|
29
|
+
const ALL_HARPER_PORTS = [OPERATIONS_API_PORT, HTTP_PORT, HTTPS_PORT, MQTT_PORT, MQTTS_PORT];
|
|
30
|
+
/** Whether we appear to be running in CI (most CI providers set CI=true). */
|
|
31
|
+
const IS_CI = !!process.env.CI;
|
|
32
|
+
/**
|
|
33
|
+
* Maximum time to wait between chunks of Harper startup output before treating the process
|
|
34
|
+
* as hung. The startup watchdog resets this window on every chunk of output, so the limit is
|
|
35
|
+
* time-since-last-progress rather than total boot time: a slow-but-healthy boot that keeps
|
|
36
|
+
* logging never trips it — only true silence does.
|
|
37
|
+
*
|
|
38
|
+
* Override with `HARPER_INTEGRATION_TEST_STARTUP_TIMEOUT_MS`. Default 60s.
|
|
39
|
+
*/
|
|
27
40
|
export const DEFAULT_STARTUP_TIMEOUT_MS = parseInt(process.env.HARPER_INTEGRATION_TEST_STARTUP_TIMEOUT_MS || '', 10) || 60000;
|
|
41
|
+
/**
|
|
42
|
+
* Absolute ceiling on total startup time, regardless of ongoing output — a generous backstop
|
|
43
|
+
* so a process that chatters forever without ever reporting ready still fails. Higher under CI,
|
|
44
|
+
* where shared/contended runners boot more slowly.
|
|
45
|
+
*
|
|
46
|
+
* Override with `HARPER_INTEGRATION_TEST_STARTUP_MAX_MS`. Default 120s (300s under CI).
|
|
47
|
+
*/
|
|
48
|
+
export const DEFAULT_STARTUP_MAX_MS = parseInt(process.env.HARPER_INTEGRATION_TEST_STARTUP_MAX_MS || '', 10) || (IS_CI ? 300000 : 120000);
|
|
49
|
+
/**
|
|
50
|
+
* Grace period after SIGTERM before escalating to SIGKILL during teardown, giving Harper time
|
|
51
|
+
* to shut down cleanly (flush RocksDB, release ports, reap worker children).
|
|
52
|
+
*
|
|
53
|
+
* Override with `HARPER_INTEGRATION_TEST_TEARDOWN_GRACE_MS`. Default 5s.
|
|
54
|
+
*/
|
|
55
|
+
export const DEFAULT_TEARDOWN_GRACE_MS = parseInt(process.env.HARPER_INTEGRATION_TEST_TEARDOWN_GRACE_MS || '', 10) || 5000;
|
|
56
|
+
/**
|
|
57
|
+
* Time teardown's safety assertion waits for Harper's fixed ports to be free before recycling the
|
|
58
|
+
* loopback address. Killing Harper's process tree (and waiting for exit) should free them
|
|
59
|
+
* immediately, so this normally returns on the first check; it only matters if a child process
|
|
60
|
+
* escaped the kill. If the ports are still in use at the deadline, the address is recycled anyway
|
|
61
|
+
* (no worse than not waiting) and a warning is logged.
|
|
62
|
+
*
|
|
63
|
+
* Override with `HARPER_INTEGRATION_TEST_PORT_RELEASE_TIMEOUT_MS`. Default 5s.
|
|
64
|
+
*/
|
|
65
|
+
export const DEFAULT_PORT_RELEASE_TIMEOUT_MS = parseInt(process.env.HARPER_INTEGRATION_TEST_PORT_RELEASE_TIMEOUT_MS || '', 10) || 5000;
|
|
66
|
+
/** Short backstop wait for the process 'exit' event after sending SIGKILL during teardown. */
|
|
67
|
+
const SIGKILL_EXIT_WAIT_MS = 1000;
|
|
28
68
|
/**
|
|
29
69
|
* The runtime to use for running Harper during tests.
|
|
30
70
|
* Set via the HARPER_RUNTIME environment variable ('node' or 'bun').
|
|
@@ -136,8 +176,10 @@ export class HarperStartupError extends Error {
|
|
|
136
176
|
* (`stdout.log` and `stderr.log`) in that directory.
|
|
137
177
|
*
|
|
138
178
|
* @throws {HarperStartupError} If the command times out or exits with a non-zero status code
|
|
179
|
+
*
|
|
180
|
+
* Exported for unit testing; not part of the public API (not re-exported from `index.ts`).
|
|
139
181
|
*/
|
|
140
|
-
function runHarperCommand({ args, env, completionMessage, logDir, harperBinPath, timeoutMs, }) {
|
|
182
|
+
export function runHarperCommand({ args, env, completionMessage, logDir, harperBinPath, timeoutMs, maxMs, }) {
|
|
141
183
|
const harperScript = getHarperScript(harperBinPath);
|
|
142
184
|
const runtime = HARPER_RUNTIME;
|
|
143
185
|
const runtimeArgs = runtime === 'bun'
|
|
@@ -145,47 +187,107 @@ function runHarperCommand({ args, env, completionMessage, logDir, harperBinPath,
|
|
|
145
187
|
: ['--trace-warnings', '--force-node-api-uncaught-exceptions-policy=true', harperScript, ...args];
|
|
146
188
|
const proc = spawn(runtime, runtimeArgs, {
|
|
147
189
|
env: { ...process.env, ...env },
|
|
190
|
+
// On POSIX, run Harper as its own process-group leader so teardown can signal the whole
|
|
191
|
+
// group (parent + any worker children), not just the direct child. Windows has no process
|
|
192
|
+
// groups; killHarper uses `taskkill /T` there instead. stdio stays piped (not detached),
|
|
193
|
+
// and we never unref, so output capture and lifetime management are unchanged.
|
|
194
|
+
detached: process.platform !== 'win32',
|
|
148
195
|
});
|
|
196
|
+
// Reap this process's tree if the runner exits/is interrupted before teardown (it's detached,
|
|
197
|
+
// so it would otherwise survive signals sent to the runner's group).
|
|
198
|
+
trackHarperProcess(proc);
|
|
149
199
|
let stdoutStream;
|
|
150
200
|
let stderrStream;
|
|
151
201
|
if (logDir) {
|
|
152
202
|
stdoutStream = createWriteStream(join(logDir, 'stdout.log'));
|
|
153
203
|
stderrStream = createWriteStream(join(logDir, 'stderr.log'));
|
|
154
204
|
}
|
|
155
|
-
const
|
|
205
|
+
const idleTimeoutMs = timeoutMs ?? DEFAULT_STARTUP_TIMEOUT_MS;
|
|
206
|
+
const maxTimeoutMs = maxMs ?? DEFAULT_STARTUP_MAX_MS;
|
|
156
207
|
return new Promise((resolve, reject) => {
|
|
157
208
|
let stdout = '';
|
|
158
209
|
let stderr = '';
|
|
159
|
-
let
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
210
|
+
let settled = false;
|
|
211
|
+
let idleTimer;
|
|
212
|
+
let maxTimer;
|
|
213
|
+
const clearTimers = () => {
|
|
214
|
+
clearTimeout(idleTimer);
|
|
215
|
+
clearTimeout(maxTimer);
|
|
216
|
+
};
|
|
217
|
+
const failStartup = (message) => {
|
|
218
|
+
if (settled)
|
|
219
|
+
return;
|
|
220
|
+
settled = true;
|
|
221
|
+
clearTimers();
|
|
222
|
+
reject(new HarperStartupError(message, stdout, stderr));
|
|
223
|
+
// Harper is spawned detached (its own process group), so `proc.kill()` would only hit the
|
|
224
|
+
// direct child and orphan any worker children still holding ports. Reap the whole tree.
|
|
225
|
+
signalHarperTree(proc, 'SIGKILL');
|
|
226
|
+
};
|
|
227
|
+
const succeed = () => {
|
|
228
|
+
if (settled)
|
|
229
|
+
return;
|
|
230
|
+
settled = true;
|
|
231
|
+
clearTimers();
|
|
232
|
+
resolve({ process: proc, stdout, stderr });
|
|
233
|
+
};
|
|
234
|
+
// Reset on every chunk of output so the limit is time-since-last-progress, not total boot
|
|
235
|
+
// time: a slow-but-healthy boot that keeps logging never trips it, only true silence does.
|
|
236
|
+
const resetIdleTimer = () => {
|
|
237
|
+
if (settled)
|
|
238
|
+
return;
|
|
239
|
+
clearTimeout(idleTimer);
|
|
240
|
+
idleTimer = setTimeout(() => failStartup(`Harper produced no startup output for ${idleTimeoutMs}ms before reporting ready (likely hung)`), idleTimeoutMs);
|
|
241
|
+
};
|
|
242
|
+
// Absolute backstop, regardless of ongoing output.
|
|
243
|
+
maxTimer = setTimeout(() => failStartup(`Harper did not report ready within the maximum startup time of ${maxTimeoutMs}ms`), maxTimeoutMs);
|
|
244
|
+
resetIdleTimer();
|
|
163
245
|
proc.stdout?.on('data', (data) => {
|
|
164
246
|
const dataString = stripAnsi(data.toString());
|
|
165
247
|
stdoutStream?.write(dataString);
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
248
|
+
// Once ready, keep streaming logs to disk but stop the watchdog and capture: the
|
|
249
|
+
// returned startupOutput is a snapshot taken at readiness, and the server may run
|
|
250
|
+
// (and log) for the rest of the suite.
|
|
251
|
+
if (settled)
|
|
252
|
+
return;
|
|
253
|
+
resetIdleTimer();
|
|
170
254
|
stdout += dataString;
|
|
255
|
+
// Match against the accumulated output, not just this chunk, so a marker split across
|
|
256
|
+
// two stream chunks is still detected.
|
|
257
|
+
if (completionMessage && stdout.includes(completionMessage)) {
|
|
258
|
+
succeed();
|
|
259
|
+
}
|
|
171
260
|
});
|
|
172
261
|
proc.stderr?.on('data', (data) => {
|
|
173
262
|
const dataString = stripAnsi(data.toString());
|
|
174
263
|
stderrStream?.write(dataString);
|
|
264
|
+
if (settled)
|
|
265
|
+
return;
|
|
266
|
+
resetIdleTimer();
|
|
175
267
|
stderr += dataString;
|
|
176
268
|
});
|
|
177
269
|
proc.on('error', (error) => {
|
|
270
|
+
if (settled)
|
|
271
|
+
return;
|
|
272
|
+
settled = true;
|
|
273
|
+
clearTimers();
|
|
274
|
+
// 'exit' won't fire for a failed spawn, so close the log streams here to avoid leaking FDs.
|
|
275
|
+
stdoutStream?.end();
|
|
276
|
+
stderrStream?.end();
|
|
178
277
|
reject(error);
|
|
179
278
|
});
|
|
180
279
|
proc.on('exit', (statusCode, signal) => {
|
|
181
|
-
|
|
182
|
-
if (
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
280
|
+
clearTimers();
|
|
281
|
+
if (!settled) {
|
|
282
|
+
settled = true;
|
|
283
|
+
if (statusCode === 0) {
|
|
284
|
+
resolve({ process: proc, stdout, stderr });
|
|
285
|
+
}
|
|
286
|
+
else {
|
|
287
|
+
const errorMessage = `Harper process failed with exit code/signal ${statusCode ?? signal}`;
|
|
288
|
+
stderrStream?.write(errorMessage);
|
|
289
|
+
reject(new HarperStartupError(errorMessage, stdout, stderr));
|
|
290
|
+
}
|
|
189
291
|
}
|
|
190
292
|
stdoutStream?.end();
|
|
191
293
|
stderrStream?.end();
|
|
@@ -206,7 +308,7 @@ function runHarperCommand({ args, env, completionMessage, logDir, harperBinPath,
|
|
|
206
308
|
export async function setupHarperWithFixture(ctx, fixturePath, options) {
|
|
207
309
|
const dataRootDirPrefix = join(process.env.HARPER_INTEGRATION_TEST_INSTALL_PARENT_DIR || tmpdir(), 'harper-integration-test-');
|
|
208
310
|
const dataRootDir = await mkdtemp(dataRootDirPrefix);
|
|
209
|
-
await cp(fixturePath, join(dataRootDir, 'components', basename(fixturePath)), { recursive: true });
|
|
311
|
+
await cp(fixturePath, join(dataRootDir, 'components', basename(fixturePath)), { recursive: true, dereference: true });
|
|
210
312
|
ctx.harper = { dataRootDir };
|
|
211
313
|
return startHarper(ctx, options);
|
|
212
314
|
}
|
|
@@ -287,6 +389,7 @@ export async function startHarper(ctx, options) {
|
|
|
287
389
|
logDir,
|
|
288
390
|
harperBinPath: options?.harperBinPath,
|
|
289
391
|
timeoutMs: options?.startupTimeoutMs,
|
|
392
|
+
maxMs: options?.startupMaxMs,
|
|
290
393
|
});
|
|
291
394
|
ctx.harper = {
|
|
292
395
|
dataRootDir,
|
|
@@ -304,28 +407,125 @@ export async function startHarper(ctx, options) {
|
|
|
304
407
|
return ctx;
|
|
305
408
|
}
|
|
306
409
|
/**
|
|
307
|
-
*
|
|
308
|
-
*
|
|
410
|
+
* Signals Harper's entire process tree, not just the direct child.
|
|
411
|
+
*
|
|
412
|
+
* Harper runs its listeners in worker threads (in-process), but components can also spawn
|
|
413
|
+
* child processes, so we target the whole tree to be safe:
|
|
414
|
+
* - POSIX: Harper is spawned as its own process-group leader (`detached`), so a negative PID
|
|
415
|
+
* signals the group (parent + descendants).
|
|
416
|
+
* - Windows: there are no process groups, so we shell out to `taskkill /T` (tree). `/F` (force)
|
|
417
|
+
* is required to actually terminate console processes, so it is used for the SIGKILL step.
|
|
418
|
+
*
|
|
419
|
+
* Best-effort: errors (e.g. the process already exited) are swallowed; teardown's port assertion
|
|
420
|
+
* and the wait-for-exit are the safety nets.
|
|
309
421
|
*/
|
|
310
|
-
|
|
311
|
-
|
|
422
|
+
function signalHarperTree(proc, signal) {
|
|
423
|
+
const pid = proc.pid;
|
|
424
|
+
if (pid === undefined)
|
|
312
425
|
return;
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
426
|
+
if (process.platform === 'win32') {
|
|
427
|
+
const args = ['/pid', String(pid), '/T'];
|
|
428
|
+
if (signal === 'SIGKILL')
|
|
429
|
+
args.push('/F');
|
|
430
|
+
try {
|
|
431
|
+
spawn('taskkill', args, { stdio: 'ignore' }).on('error', () => { });
|
|
432
|
+
}
|
|
433
|
+
catch {
|
|
321
434
|
try {
|
|
322
|
-
|
|
435
|
+
proc.kill(signal);
|
|
323
436
|
}
|
|
324
437
|
catch {
|
|
325
|
-
//
|
|
438
|
+
// process already gone
|
|
326
439
|
}
|
|
440
|
+
}
|
|
441
|
+
return;
|
|
442
|
+
}
|
|
443
|
+
try {
|
|
444
|
+
// Negative PID => signal the whole process group (proc is the group leader via `detached`).
|
|
445
|
+
process.kill(-pid, signal);
|
|
446
|
+
}
|
|
447
|
+
catch {
|
|
448
|
+
// Group already gone, or (defensively) not a group leader — fall back to the direct child.
|
|
449
|
+
try {
|
|
450
|
+
proc.kill(signal);
|
|
451
|
+
}
|
|
452
|
+
catch {
|
|
453
|
+
// process already gone
|
|
454
|
+
}
|
|
455
|
+
}
|
|
456
|
+
}
|
|
457
|
+
/**
|
|
458
|
+
* Tracks live Harper processes so that if the test runner exits or is interrupted before teardown
|
|
459
|
+
* runs (Ctrl+C, or a CI job killing the runner), their process trees are reaped instead of left
|
|
460
|
+
* orphaned holding the fixed ports. This matters specifically because Harper is spawned `detached`
|
|
461
|
+
* (its own process group), so it would otherwise survive signals delivered to the runner's group.
|
|
462
|
+
*
|
|
463
|
+
* Best-effort: on POSIX the group SIGKILL is delivered synchronously (works even from the 'exit'
|
|
464
|
+
* handler); on Windows the `taskkill` shell-out may not complete before the runner exits.
|
|
465
|
+
*/
|
|
466
|
+
const liveHarperProcesses = new Set();
|
|
467
|
+
let runnerCleanupRegistered = false;
|
|
468
|
+
function trackHarperProcess(proc) {
|
|
469
|
+
liveHarperProcesses.add(proc);
|
|
470
|
+
proc.once('exit', () => liveHarperProcesses.delete(proc));
|
|
471
|
+
if (runnerCleanupRegistered)
|
|
472
|
+
return;
|
|
473
|
+
runnerCleanupRegistered = true;
|
|
474
|
+
const reapAll = () => {
|
|
475
|
+
for (const child of liveHarperProcesses)
|
|
476
|
+
signalHarperTree(child, 'SIGKILL');
|
|
477
|
+
};
|
|
478
|
+
process.once('exit', reapAll);
|
|
479
|
+
// SIGINT/SIGTERM don't fire 'exit'; reap, then re-raise so the runner still terminates normally.
|
|
480
|
+
for (const signal of ['SIGINT', 'SIGTERM']) {
|
|
481
|
+
process.once(signal, () => {
|
|
482
|
+
reapAll();
|
|
483
|
+
process.kill(process.pid, signal);
|
|
484
|
+
});
|
|
485
|
+
}
|
|
486
|
+
}
|
|
487
|
+
/**
|
|
488
|
+
* Kill harper process (can be used for teardown, or killing it before a restart).
|
|
489
|
+
*
|
|
490
|
+
* Sends SIGTERM to Harper's whole process tree first and gives it a grace period to shut down
|
|
491
|
+
* cleanly (flush RocksDB, release ports, reap worker children) before escalating to SIGKILL.
|
|
492
|
+
* After SIGKILL it waits briefly for the process to actually exit, so callers can rely on it
|
|
493
|
+
* being gone — and, since a dead process releases its listening sockets, on its ports being free.
|
|
494
|
+
*
|
|
495
|
+
* @param ctx
|
|
496
|
+
* @param options.graceMs Time to wait after SIGTERM before sending SIGKILL. Defaults to
|
|
497
|
+
* {@link DEFAULT_TEARDOWN_GRACE_MS}.
|
|
498
|
+
*/
|
|
499
|
+
export async function killHarper(ctx, options) {
|
|
500
|
+
const proc = ctx.harper?.process;
|
|
501
|
+
if (!proc)
|
|
502
|
+
return;
|
|
503
|
+
// Already exited — nothing to do.
|
|
504
|
+
if (proc.exitCode !== null || proc.signalCode !== null)
|
|
505
|
+
return;
|
|
506
|
+
const graceMs = options?.graceMs ?? DEFAULT_TEARDOWN_GRACE_MS;
|
|
507
|
+
await new Promise((resolve) => {
|
|
508
|
+
let done = false;
|
|
509
|
+
let sigkillTimer;
|
|
510
|
+
let backstopTimer;
|
|
511
|
+
const finish = () => {
|
|
512
|
+
if (done)
|
|
513
|
+
return;
|
|
514
|
+
done = true;
|
|
515
|
+
proc.off('exit', finish);
|
|
516
|
+
clearTimeout(sigkillTimer);
|
|
517
|
+
clearTimeout(backstopTimer);
|
|
327
518
|
resolve();
|
|
328
|
-
}
|
|
519
|
+
};
|
|
520
|
+
proc.once('exit', finish);
|
|
521
|
+
// Ask the whole Harper tree to shut down cleanly first.
|
|
522
|
+
signalHarperTree(proc, 'SIGTERM');
|
|
523
|
+
// If it hasn't exited within the grace period, force-kill the tree and wait briefly for the
|
|
524
|
+
// 'exit' event before resolving (with a backstop in case it never fires).
|
|
525
|
+
sigkillTimer = setTimeout(() => {
|
|
526
|
+
signalHarperTree(proc, 'SIGKILL');
|
|
527
|
+
backstopTimer = setTimeout(finish, SIGKILL_EXIT_WAIT_MS);
|
|
528
|
+
}, graceMs);
|
|
329
529
|
});
|
|
330
530
|
}
|
|
331
531
|
/**
|
|
@@ -352,6 +552,18 @@ export async function teardownHarper(ctx) {
|
|
|
352
552
|
if (!ctx.harper)
|
|
353
553
|
return;
|
|
354
554
|
await killHarper(ctx);
|
|
555
|
+
// Safety assertion: killHarper waits for Harper's process tree to exit, which releases its
|
|
556
|
+
// listening sockets, so the fixed ports should already be free here. We still verify before
|
|
557
|
+
// recycling the address (the pool only guarantees the *address* is bindable, not that these
|
|
558
|
+
// specific ports are free) and warn if anything is somehow still holding them — that warning
|
|
559
|
+
// is a signal that a Harper child process escaped the tree kill, not normal operation. The
|
|
560
|
+
// address is recycled regardless.
|
|
561
|
+
if (ctx.harper.hostname) {
|
|
562
|
+
const portsFreed = await waitForPortsFree(ctx.harper.hostname, ALL_HARPER_PORTS, DEFAULT_PORT_RELEASE_TIMEOUT_MS);
|
|
563
|
+
if (!portsFreed) {
|
|
564
|
+
console.warn(`Harper ports on ${ctx.harper.hostname} still in use after teardown (${DEFAULT_PORT_RELEASE_TIMEOUT_MS}ms); recycling the address anyway. This usually means a Harper child process outlived the kill.`);
|
|
565
|
+
}
|
|
566
|
+
}
|
|
355
567
|
await releaseLoopbackAddress(ctx.harper.hostname);
|
|
356
568
|
// a few retries are typically necessary, might take a sec for a process to finish, especially since rocksdb may be flushing
|
|
357
569
|
try {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"harperLifecycle.js","sourceRoot":"","sources":["../src/harperLifecycle.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AACzD,OAAO,EAAE,iBAAiB,EAAE,UAAU,EAAoB,MAAM,SAAS,CAAC;AAC1E,OAAO,EAAE,IAAI,EAAE,QAAQ,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACpD,OAAO,EAAE,MAAM,EAAE,MAAM,SAAS,CAAC;AACjC,OAAO,EAAE,OAAO,EAAE,KAAK,EAAE,EAAE,EAAE,EAAE,E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,MAAM,EAAE,GAAG,EAAE,IAAI,CAAC,SAAS,CAAC,YAAY,CAAC,CAAC,CAAC;IAC1D,OAAO,YAAY,CAAC;AACrB,CAAC"}
|
|
@@ -3,10 +3,10 @@
|
|
|
3
3
|
* bind to each one. It returns an object containing arrays of successfully bound
|
|
4
4
|
* loopback addresses and those that failed along with their errors.
|
|
5
5
|
*
|
|
6
|
-
* It will check all loopback addresses from 127.0.0.
|
|
6
|
+
* It will check all loopback addresses from 127.0.0.2 to 127.0.0.33 (by default).
|
|
7
7
|
*
|
|
8
8
|
* Use the HARPER_INTEGRATION_TEST_LOOPBACK_POOL_COUNT environment variable to
|
|
9
|
-
* adjust the number of loopback addresses to validate (up to
|
|
9
|
+
* adjust the number of loopback addresses to validate (up to 254).
|
|
10
10
|
*/
|
|
11
11
|
export declare function validateLoopbackAddressPool(): Promise<{
|
|
12
12
|
successful: string[];
|
|
@@ -39,7 +39,7 @@ export declare function getNextAvailableLoopbackAddress(): Promise<string>;
|
|
|
39
39
|
/**
|
|
40
40
|
* Releases a loopback address back to the pool, making it available for other processes.
|
|
41
41
|
*
|
|
42
|
-
* @param address The loopback address to release (e.g., "127.0.0.
|
|
42
|
+
* @param address The loopback address to release (e.g., "127.0.0.2")
|
|
43
43
|
* @throws InvalidLoopbackAddressError if the address format is invalid
|
|
44
44
|
*/
|
|
45
45
|
export declare function releaseLoopbackAddress(address: string): Promise<void>;
|