You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
fix(test): process-runner streaming tests wait for the child's output - #1987
Implement: audit done Review: round 1 at e965d29, passed Hardware: n/a Gate: red 1x
Next: the gate again
Ledger:
no findings raised. The code lens removed the pause, and separately made the grace and close paths ignore pending deliveries. The guards still failed on named assertions. Its delayed-child runs also passed: 3000 ms once, 600 ms 8 of 8 under load.
State: {"issue":1982,"branch":"bug/1982","pr":1987,"last":"0a3ae0fe7585","done":"gate","mode":"audit","built":1,"audited":true,"assessment":"complete","rounds":["1:e965d29e6cb83d5de4705edf1f6365f2727430a7"],"round":"1","commit":"e965d29e6cb83d5de4705edf1f6365f2727430a7","checkedBase":"dead1fb26cdf770004058663e3e30d54cdbddcab","reviewBase":"dead1fb26cdf770004058663e3e30d54cdbddcab","lenses":3,"findings":"/var/folders/tb/j39z273s5kn7lb9tz1dhk8l00000gn/T/review-1987.WSEEev/findings.json","gate":{"red":1,"fixes":0,"refusal":"not merged: CI not green on PR fix(test): process-runner streaming tests wait for the child's output #1987: fail Quality;fail Unit tests;","merged":null},"unknown":["src/daemon/dispatcher-usage.test.ts > Dispatcher: usage.get > usage.get answers INTERNAL to a call in flight when the read thread exits, and answers the next call from a new thread (CI run 46432724917)"]}
No actionable comments were generated in the recent review.
Walkthrough
The backpressure and exit-grace tests now delay child startup by 600 ms. They wait for the relevant output and process state before checking delivery behavior.
Suggested reviewers:miospotdevteam, leonardoxr
Severity of issue fixed: Low
Merge Risk: Minimal · up to e965d
This change makes streaming tests wait for the child process's output instead of relying on fixed delays, which reduces flakiness under slow startup. It does not alter product behavior and the risk of merging is minimal. The Quality check failure should be looked at, but it is not linked to this diff.
Pre-merge checks: 4
Check name
Status
Explanation
Title check
The title names the main change: the process-runner streaming tests now wait for the child's output instead of relying on fixed delays. The raw summary and the linked objectives both describe this cha…
Linked Issues check
[#1982] The issue requires that the streaming tests in src/ports/process-runner.test.ts stop depending on fixed real-time waits before asserting a spawned child's output. The diff at e965d29 meets thi…
Out of Scope Changes check
The whole-PR diff against merge base dead1fb touches only src/ports/process-runner.test.ts. All hunks change the two tests named in #1982 or add the shared startsLate helper they use. The helper is…
Description check
The description is related to the changeset. It references issue #1982 and describes a review ledger, a gate run, and delayed-child test runs (3000 ms once, 600 ms 8 of 8 under load). These match the …
Full details: Title check
Explanation
The title names the main change: the process-runner streaming tests now wait for the child's output instead of relying on fixed delays. The raw summary and the linked objectives both describe this change, so the title matches the changeset.
Full details: Linked Issues check
Explanation
[#1982] The issue requires that the streaming tests in src/ports/process-runner.test.ts stop depending on fixed real-time waits before asserting a spawned child's output. The diff at e965d29 meets this for both cited locations. (1) Line ~229 (first test, previously a 200 ms wait then asserting seen has length 1): the diff adds await waitUntil(() => seen.length > 0) before the 200 ms pause. The output assertion now runs only after the first chunk arrives. The remaining 200 ms pause is a negative check that verifies the stream is paused. It does not gate the presence of output. (2) Line ~334 (exit-grace test, previously a 400 ms wait then asserting 'before-exit-Abefore-exit-B'): the diff adds await waitUntil(() => seen.join("") === "before-exit-Abefore-exit-B" && !isAlive(handle.pid)) before the wait() assertions. The child's startup delay is reproduced with a startsLate prefix, which busy-waits 600 ms through Atomics.wait in both children. This matches the reproduction in the issue. The tests use condition-based waits for output presence, so they tolerate a slow child start. Non-coding items (manual runs, gate, reviews) do not apply. Limitations: I did not run the test suite. The PR's reported run results are author claims, not verified here.
Full details: Out of Scope Changes check
Explanation
The whole-PR diff against merge base dead1fb touches only src/ports/process-runner.test.ts. All hunks change the two tests named in #1982 or add the shared startsLate helper they use. The helper is a comment plus one string constant. The renamed test titles and comments describe the same delayed-start cases. No production code, exported declarations, or unrelated tests changed. The review note in the PR objectives about another fixed wait near line 874/910 is not in this diff. It concerns a separate test, and the PR does not claim to fix it. Its related issues (#1985, #1986) are not linked here, so it is not a scope violation of this PR.
Full details: Description check
Explanation
The description is related to the changeset. It references issue #1982 and describes a review ledger, a gate run, and delayed-child test runs (3000 ms once, 600 ms 8 of 8 under load). These match the change to process-runner.test.ts, which adds a 600 ms startup delay and waits for output instead of fixed pauses. The description contains specific, relevant content, but it also reports that the gate is red and CI is not green. That is useful context and does not make the description off-topic.
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.
File: No configuration file from this repository applied
Commit: Unavailable
Layers: Repository UI
Review profile: QUIET
Plan: Advanced
Run ID: 26fade44-d53f-471e-98db-4164864b37c5
Commits
Reviewing files that changed from the base of the PR and between dead1fb and e965d29.
Files selected for processing: 1
src/ports/process-runner.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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #1982
Status
Implement: audit done Review: round 1 at e965d29, passed Hardware: n/a Gate: red 1x
Next: the gate again
Ledger:
State: {"issue":1982,"branch":"bug/1982","pr":1987,"last":"0a3ae0fe7585","done":"gate","mode":"audit","built":1,"audited":true,"assessment":"complete","rounds":["1:e965d29e6cb83d5de4705edf1f6365f2727430a7"],"round":"1","commit":"e965d29e6cb83d5de4705edf1f6365f2727430a7","checkedBase":"dead1fb26cdf770004058663e3e30d54cdbddcab","reviewBase":"dead1fb26cdf770004058663e3e30d54cdbddcab","lenses":3,"findings":"/var/folders/tb/j39z273s5kn7lb9tz1dhk8l00000gn/T/review-1987.WSEEev/findings.json","gate":{"red":1,"fixes":0,"refusal":"not merged: CI not green on PR fix(test): process-runner streaming tests wait for the child's output #1987: fail Quality;fail Unit tests;","merged":null},"unknown":["src/daemon/dispatcher-usage.test.ts > Dispatcher: usage.get > usage.get answers INTERNAL to a call in flight when the read thread exits, and answers the next call from a new thread (CI run 46432724917)"]}
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.8M.
Runs: 6. Cost USD: 0.8385. Agent seconds: 492.
Assessment: complete
Written by an agent.