Skip to content

test(daemon-client): tighten the case that proves the crossing - #4900

Merged
thymikee merged 1 commit into
mainfrom
t3/fix-daemon-client-lifecycle-timeouts
Nov 21, 2026
Merged

thymikee merged 1 commit into
mainfrom
t3/fix-daemon-client-lifecycle-timeouts

Conversation

@thymikee

@thymikee thymikee commented Nov 21, 2026 •

Copy link
Copy Markdown
Member

Summary

Follow-up to #4896, from its review. The crossing this file proves was asserted on a thin margin and with one step too many.

Shorten the gate on the outlived call's first start from 700 ms to 250 ms. Its second start then lands about 400 ms into the next case, whose own window stays 1 s, so detection goes from a 350 ms margin to 2.5x, and the two cases cost 1.7 s of wall clock instead of 2.35 s. Drop the third launch step: a failed local startup makes two starts, so a spare step would swallow a production change that started a third daemon instead of the plan refusing it.

Both cases now assert the in-flight set they are about: the leaking case says its call was still running when its case ended, the next says it inherited none. The launch-seam count stays as the second net. The join's own limit is stated where the bound is: a call cannot be cancelled, so one outlasting the join still hands its launches to the next case.

No production change. Relates #4848.

Validation

At head 9c7e658d36: the file green on 12 runs and on 56 more with eight copies in parallel on a 12-core host; the two cases at 725 ms and 1,012 ms against the 2,500 ms budget; the package, 353 passed; tsc -b, oxlint and oxfmt clean. Detection proven at head with only the join removed:

x the call that outlived the case before this one records no launch here
  -> the case before this one left no call in flight
Tests  1 failed | 25 passed (26)

CI owns the rest. Not device-facing.

🤖 Generated with Claude Code

The review asked for the crossing to be cheaper and sharper.

Shorten the gate on the first start from 700 ms to 250 ms: the outlived call's second start then
lands about 400 ms into the next case, whose own window stays 1 s, so detection goes from a 350 ms
margin to 2.5x. Drop the third launch step: a failed local startup makes two starts, and a spare
step would swallow a production change that started a third daemon instead of the plan refusing it.

Both cases now assert the in-flight set they are about: the leaking case says its call was still
running when it ended, and the next case says it inherited none. The launch-seam count stays as the
second net. Keep the join bound's own limit in its docblock: a call cannot be cancelled, so one that
outlasts the join still hands its remaining launches to the next case.
@github-actions

Copy link
Copy Markdown
Contributor

Size Report

Metric Base Current Diff
Installed (including dependencies) 6.48 MB 6.48 MB 0 B
Package (unpacked) 6.48 MB 6.48 MB 0 B
Package (download) 1.98 MB 1.98 MB +3 B

Startup median (7 runs, lower is better):

Scenario Base Current Diff
CLI --version 21.4 ms 18.5 ms -2.9 ms
CLI --help 42.0 ms 43.2 ms +1.2 ms

@apex-sentinel-staging

Copy link
Copy Markdown

Apex Sentinel · ✅ Approve · review of 9c7e658

No open findings.

1 finding below minor hidden (user_settings.min_severity).

Reviewed with this repository's own Sentinel configuration (721adbc6985f).

💬 Talking to Sentinel

In a finding's thread, reply with:

Command What it does
@apex-sentinel-staging note <context> Adds context; Sentinel re-checks the cited code
@apex-sentinel-staging pivot <why> Says the finding is wrong; Sentinel re-checks the cited code
@apex-sentinel-staging like Marks the finding as useful
@apex-sentinel-staging dislike <why> Marks it as not useful, so it is not raised again

On this conversation, comment @apex-sentinel-staging review to run a full review once again.

@thymikee

Copy link
Copy Markdown
Member Author

Reviewed 9c7e658. The change reads correctly and the tightened case does prove the crossing. The two Body rules runs show as cancelled. They look like superseded runs, because that workflow cancels in-progress runs on edit and push events, and the diff touches only a test file. The other 23 checks pass. Not verified here: the test file and the join-removed mutation were not run, so the PR body's quoted output was relied on, and no later Body rules run was checked. Before merge, confirm the latest Body rules run is green.

@thymikee thymikee added the ready-for-human Valid work that needs human implementation, judgment, or maintainer merge label Nov 21, 2026
@thymikee
thymikee merged commit 0708a19 into main Nov 21, 2026
23 of 25 checks passed
@thymikee
thymikee deleted the t3/fix-daemon-client-lifecycle-timeouts branch November 21, 2026 15:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ready-for-human Valid work that needs human implementation, judgment, or maintainer merge

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant