Summary
Two timing-sensitive integration tests fail intermittently on loaded CI runners (observed on master CI run 27133947713). Both pass reliably locally.
Failures observed
- macos —
test/cli/logs.test.ts:462 › "continues watching old file if no new file appears": stdout contained the initial line but not APPENDED_LINE.
- ubuntu —
test/cli/daemon-kubo-restart-race.test.ts:262 › "kubo is killed on SIGTERM even when a signal-exit handler registered after the exit hook": expect(kuboRestarted).toBe(true) (setup precondition) timed out. Ran 43.8s on CI; passes in ~13s locally.
Root cause
- logs -f tests: the 8s SIGINT kill timer is anchored to process spawn. The budget must cover CLI cold-start (oclif/pkc-js import, which can be several seconds) + printing the initial marker + detecting the file change + flushing the second marker. On a slow runner, startup eats the budget and the process is killed before the awaited line is emitted. All three tests in the
bitsocial logs -f (file rotation) block share this pattern.
- restart-race test: the restarted-kubo detect window (
waitForCondition, 30s) is too tight given the test injects PKC_CLI_TEST_IPFS_READY_DELAY_MS=5000 and the runner may be heavily loaded with parallel kubo nodes. The overall test timeout is 120s, so there is headroom to widen.
Fix
- logs -f tests: kill as soon as the awaited output is observed, with a generous safety-cap timeout instead of a fixed 8s wall.
- restart-race test: widen the restarted-kubo detect window to account for the injected ready delay + runner load.
These are test-harness robustness fixes; no production code change.
Summary
Two timing-sensitive integration tests fail intermittently on loaded CI runners (observed on master CI run 27133947713). Both pass reliably locally.
Failures observed
test/cli/logs.test.ts:462› "continues watching old file if no new file appears": stdout contained the initial line but notAPPENDED_LINE.test/cli/daemon-kubo-restart-race.test.ts:262› "kubo is killed on SIGTERM even when a signal-exit handler registered after the exit hook":expect(kuboRestarted).toBe(true)(setup precondition) timed out. Ran 43.8s on CI; passes in ~13s locally.Root cause
bitsocial logs -f (file rotation)block share this pattern.waitForCondition, 30s) is too tight given the test injectsPKC_CLI_TEST_IPFS_READY_DELAY_MS=5000and the runner may be heavily loaded with parallel kubo nodes. The overall test timeout is 120s, so there is headroom to widen.Fix
These are test-harness robustness fixes; no production code change.