/** * Shared deadline-based polling and process-kill verification helpers for the * test suite. Test-only: nothing in src/ production code may import this file. */ export interface WaitUntilOptions { /** Total time to wait before failing (default 5s). */ timeoutMs?: number; /** Poll interval (default 5ms). */ intervalMs?: number; /** Included in the timeout error to identify the stuck condition. */ label?: string; } /** * Poll `check` until it returns a truthy value, with a hard deadline. * Returns the first truthy value; throws once the deadline passes so a stuck * condition fails the test instead of silently falling through. */ export declare function waitUntil(check: () => T | undefined | null | false | Promise, opts?: WaitUntilOptions): Promise; /** * Shell command that blocks until `gate` exists, then writes `text` to * `marker`. Replaces fixed `sleep N; printf ...` fixtures: the child stays * alive (blocked on the gate) for exactly as long as the test needs, and a * kill can be proven by opening the gate and observing that the marker never * appears (see {@link expectMarkerNeverWritten}). */ export declare function gatedWriteCommand(gate: string, marker: string, opts?: { text?: string; append?: boolean; }): string; /** Open a {@link gatedWriteCommand} gate so a still-alive child can finish. */ export declare function openGate(gate: string): void; /** * Prove a gated child process was killed: open the gate and verify the marker * still does not appear. A surviving child polls the gate every 20ms, so the * default 250ms settle window gives it >10x the time it would need to write. */ export declare function expectMarkerNeverWritten(gate: string, marker: string, settleMs?: number): Promise;