Skip to content

test(cli): wait for the lookup child to die after the CLI exits - #6357

Merged
miguel-heygen merged 1 commit into
mainfrom
test/public-network-lookup-killed
Oct 26, 2026
Merged

miguel-heygen merged 1 commit into
mainfrom
test/public-network-lookup-killed

Conversation

@miguel-heygen

@miguel-heygen miguel-heygen commented Oct 25, 2026 •

Copy link
Copy Markdown
Collaborator

Problem

publicNetwork.process.test.ts "leaves no system lookup running when the CLI exits mid-lookup" fails now and then under load with expected true to be false.

Cause

The CLI kills its lookup child with SIGKILL as it exits. A kill takes effect a moment after the signal is sent, and the test sampled the child's state the instant the CLI's exit was seen. On a busy machine the child was still alive at that instant. The product behaviour is right; the test asserted too early.

Fix

The test waits, up to 5 s, for the child to die (the same waitForTestCondition the neighbouring process tests use). It still fails if the child is never killed: the stalled lookup outlives the wait.

Repro counts (2-CPU devbox, current main)

  • CI-shaped run, cli, core and engine suites together: 1 failure in 5 runs, this test.
  • Original test, cli suite alone: 0 of 6 failed. The test file alone under 8 CPU burners: 0 of 150.
  • With the fix, cli suite alone: 0 of 6 runs failed.

The failure only shows up in the three-suite shape, so there is no clean red-to-green; the evidence is the one sighting plus the cause above.

@heygengenesis heygengenesis Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Verdict: APPROVE · 0 blocker · 0 important · 0 nits · head 3ce5697b

Regression signal is kept: the fixture's stalled child runs setInterval forever and the CLI's execFile timeout dies with the CLI, so if killLiveLookups regressed the child would outlive the 5 s wait and the test would still fail. CI is green on this head.

Scope

Read publicNetwork.process.test.ts, processTestUtils.ts (waitForTestCondition throws on timeout; testProcessIsAlive treats Z/X as dead), publicNetwork.fixture.ts, and systemLookupInKillableChild/killLiveLookups in publicNetwork.ts. Windows render verification was still running at review time; it does not cover this test.

@miguel-heygen
miguel-heygen added this pull request to the merge queue Oct 25, 2026
Merged via the queue into main with commit e63ecd5 Oct 26, 2026
111 checks passed
@miguel-heygen
miguel-heygen deleted the test/public-network-lookup-killed branch October 26, 2026 01:15
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