Skip to content

fix(test): the stalled-delivery exec test no longer passes when its child starts late (#1996) - #2001

Merged
V3RON merged 2 commits into
mainfrom
bug/1996
Nov 30, 2026
Merged

V3RON merged 2 commits into
mainfrom
bug/1996

Conversation

@V3RON

@V3RON V3RON commented Nov 30, 2026 •

Copy link
Copy Markdown
Contributor

Closes #1996

Status

Implement: audit done Review: round 1 at 1725492, passed Hardware: n/a Gate: red 1x
Next: the gate again
Ledger:

  • R1 (code, round 1). The lens ran a control. A runner edited to drop chunks arriving more than 600 ms after spawn still passes this test. The same fault, delayed 1500 ms, fails it. Outcome nonblocking: the test now waits on the child's own output (the go file and the pid death) instead of a clock, so a late start cannot make the check vacuous. That is the issue's defect. The dropped-late-chunk fault is a different runner bug that A dispatcher-exec.test.ts stalled-delivery test passes against a broken runner when its child starts more than 600 ms late #1996 does not cover. No fix or verification SHAs.
    State: {"issue":1996,"branch":"bug/1996","pr":2001,"last":"9ecf7b3ed70a","done":"gate","mode":"audit","built":1,"audited":true,"assessment":"complete","rounds":["1:1725492cc866c57bcfaaf9887008c3ebf56974c1"],"round":"1","commit":"1725492cc866c57bcfaaf9887008c3ebf56974c1","checkedBase":"f3410e345f9b29d3fe4abd86df50e967d102868c","reviewBase":"f3410e345f9b29d3fe4abd86df50e967d102868c","lenses":3,"findings":"/var/folders/tb/j39z273s5kn7lb9tz1dhk8l00000gn/T/review-2001.ilXoEl/findings.json","gate":{"red":1,"fixes":0,"refusal":"not merged: CI not green on PR fix(test): the stalled-delivery exec test no longer passes when its child starts late (#1996) #2001: fail Quality;fail Unit tests (Windows) (3/3);","merged":null}}

Done when

  • The stalled-delivery test in src/daemon/dispatcher-exec.test.ts checks its settle state only after the child has delivered its first chunk and exited, however late the child starts (test: the whole body, waitFor on seen and isAlive) — read in the diff by review round 1; in triage the same fix passed with the child 0, 700 and 3000 ms late and failed five broken runners
  • Its two chunks cannot merge on a busy event loop (the child writes the second only once the test writes the go file) — read in the diff; in triage the same fix passed with the event loop blocked 1500 ms

Assumptions

none

Review

Spec review: 0 blocking, 0 fixed, 0 notes. Code review: 0 blocking, 0 fixed, 1 notes. Claims review: 0 blocking, 0 fixed, 0 notes.
Rounds: 1. Tokens: 0.9M.
Runs: 6. Cost USD: 0.916. Agent seconds: 384.

Rejected:

  • code: a runner that drops chunks arriving more than 600 ms after spawn stays green [nonblocking] — the issue asks only that the settle check not pass vacuously, and the rewrite meets that

Assessment: complete

Written by an agent.

@coderabbitai

coderabbitai Bot commented Nov 30, 2026 •

Copy link
Copy Markdown

Explain Change →

No actionable comments were generated in the recent review.

Walkthrough

The real-child-process test now delays the child’s second output until the test creates a file. It waits for the child to exit and checks that device.exec remains pending beyond the 300 ms exit grace while delivery of the first chunk is blocked. After releasing delivery, the test checks that execution succeeds and both chunks arrive in order. The test removes its temporary directory afterward.

Severity of issue fixed: Low

Merge Risk: Minimal · up to 17254

This change only makes a test more robust and does not alter product behavior. No concrete merge-blocking risk was found. The failed Windows unit-test job should be checked by the author before merging.

Pre-merge checks: Passed 4

Check name Status Explanation
Title check Passed The title names the change: the stalled-delivery exec test in dispatcher-exec.test.ts no longer passes when its child starts late. The raw summary and objectives confirm the test now waits for the chi…
Linked Issues check Passed [#1996] The issue requires that the stalled-delivery test at src/daemon/dispatcher-exec.test.ts ("delivers every chunk in full, in order, even when one delivery stalls past the exit grace window") not…
Out of Scope Changes check Passed [#1996] The changes are confined to src/daemon/dispatcher-exec.test.ts. The added imports (node:fs mkdtempSync, rmSync, writeFileSync; node:os tmpdir; node:path join; NodeProcessSupervisor from ../por…
Description check Passed The description is related to the changeset. It identifies issue #1996 and describes the fix to the stalled-delivery test in src/daemon/dispatcher-exec.test.ts. It says the test now waits on the child…
Full details: Title check

Explanation

The title names the change: the stalled-delivery exec test in dispatcher-exec.test.ts no longer passes when its child starts late. The raw summary and objectives confirm the test now waits for the child's first chunk and exit before checking settle state, so the title matches the main change. It is specific and single-sentence, and it refers to issue #1996.

Full details: Linked Issues check

Explanation

[#1996] The issue requires that the stalled-delivery test at src/daemon/dispatcher-exec.test.ts ("delivers every chunk in full, in order, even when one delivery stalls past the exit grace window") not pass vacuously when its child starts late. The fixed 600 ms wait is the defect. The PR summary and the reviewed head show the rewritten test: it holds the first chunk, waits for the child to exit, confirms device.exec remains pending beyond the exit grace window, then releases delivery and checks both chunks arrive in order. The test waits on the child's own output and exit (waitFor on seen and isAlive), not on a clock, so a late child start cannot make the settle check vacuous. The second chunk is written only after the test creates a go file, so the two chunks cannot merge on a busy event loop. The PR reports triage results at child delays of 0, 700 and 3000 ms and with a 1500 ms event-loop block. The issue's separate late-chunk-dropping runner fault is not required here, and the PR correctly does not claim to fix it. Limitation: the file read returned only the first 16000 bytes and the diff blob was unavailable, so I could not read the exact test body at the reviewed head. This verdict relies on the PR summary and the review evidence for that body.

Full details: Out of Scope Changes check

Explanation

[#1996] The changes are confined to src/daemon/dispatcher-exec.test.ts. The added imports (node:fs mkdtempSync, rmSync, writeFileSync; node:os tmpdir; node:path join; NodeProcessSupervisor from ../ports/index.js) support the new test mechanics: a temporary directory for the go file and a supervised child process with a timed exit guard. The temporary directory is removed afterward. No production source, runner, or public declaration changed (the summary lists no declaration changes). The reviewer's title suggestion is a nonblocking note and is not part of this PR's changes. The late-chunk-dropping runner fault is not changed, which matches the issue scope. No unrelated change was identified in the evidence available. Limitation: the full diff could not be read, so this verdict rests on the PR summary and the visible file header.

Full details: Description check

Explanation

The description is related to the changeset. It identifies issue #1996 and describes the fix to the stalled-delivery test in src/daemon/dispatcher-exec.test.ts. It says the test now waits on the child's first chunk and exit, and on a go file, instead of a fixed clock delay. It also records a review round, a gate result, and a known separate runner fault that the change does not cover. The description matches the raw summary of the test file changes.

Finishing Touches

Fix failing CI checks

  • Commit to this branch
  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

Share

Recent review info

Run configuration

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Repository UI
  • Review profile: QUIET
  • Plan: Advanced
  • Run ID: 7cd3d20a-d871-4b3e-8846-041388991078
Commits

Reviewing files that changed from the base of the PR and between f3410e3 and 1725492.

Files selected for processing: 1

  • src/daemon/dispatcher-exec.test.ts

Included review availability: This review used your included allowance. Your plan provides up to 4 included reviews per hour; 0 remain after this review.

@V3RON

V3RON commented Nov 30, 2026

Copy link
Copy Markdown
Contributor Author

Review ledger

Round 1: 1725492

Runs: 6. Cost USD: 0.916. Agent seconds: 384.
Tokens input 67, output 18201, cache read 744333, cache write 169838.
- build implementer: claude-sonnet-5-5 87 s $0.1254
- audit implementer: claude-sonnet-5-5 23 s $0.0894
- review 1 reviewer: claude-sonnet-5-5 150 s $0.0995
- review 1 spec: claude-sonnet-5-5 13 s $0.0677
- review 1 code tests: claude-opus-5-5 94 s $0.4697
- review 1 claims: claude-sonnet-5-5 17 s $0.0643
Finding outcomes: {"nonblocking":1}. Classes: {"testing 1":1}.
{"findings":[{"id":"R1","role":"code","class":"testing 1","outcome":"nonblocking","path":"src/daemon/dispatcher-exec.test.ts:667","round":"1","detail":"title overclaims late child"}]}

Written by an agent.

@V3RON

V3RON commented Nov 30, 2026

Copy link
Copy Markdown
Contributor Author

Review notes

Not blocking, not verified. Each is one reviewer's claim.

  • code: src/daemon/dispatcher-exec.test.ts:667 the title says "even when the child starts late", but the body never delays the child; "regardless of when the child starts" would be more accurate

Written by an agent.

@V3RON
V3RON marked this pull request as ready for review November 30, 2026 17:26
@V3RON
V3RON merged commit d95c152 into main Nov 30, 2026
132 of 136 checks passed
@V3RON
V3RON deleted the bug/1996 branch November 30, 2026 17:44
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.

A dispatcher-exec.test.ts stalled-delivery test passes against a broken runner when its child starts more than 600 ms late

1 participant