Skip to content

test(ipc): Drop wall-clock timing from the daemon start test - #107

Merged
4ndreello merged 1 commit into
mainfrom
test/deterministic-daemon-start
Sep 23, 2026
Merged

4ndreello merged 1 commit into
mainfrom
test/deterministic-daemon-start

Conversation

@4ndreello

Copy link
Copy Markdown
Owner

tests/ipc-daemon-start.test.ts checked that ensureDaemonStarted resolves within 50 ms of the socket accepting connections, using real sockets and wall-clock time. The code polls every 25 ms, so a loaded runner blows the budget while the code is correct: on #106 it failed on Node 26 with expected 238 to be less than or equal to 50, and passed on Node 24 in the same run.

The test now runs on fake timers with fs.existsSync and net.createConnection stubbed. The first probe fails, the daemon is spawned once, readiness flips, and the call has to settle within 50 fake ms. Nothing in src/daemon/ipc.ts changes.

Tests

  • npx vitest run tests/ipc-daemon-start.test.ts: 3 passed, five runs in a row
  • Mutation probes on a scratch copy of src/daemon/ipc.ts, all killed: poll interval raised to 51 ms, raised to 100 ms, readiness result ignored

Co-Authored-By: Codex <noreply@openai.com>
@sonarqubecloud

Copy link
Copy Markdown

@4ndreello
4ndreello merged commit 340d503 into main Sep 23, 2026
4 checks passed
@4ndreello
4ndreello deleted the test/deterministic-daemon-start branch September 23, 2026 02:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant