Skip to content

fix(test): passthrough signal tests wait for the tool's ready file - #1997

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

V3RON merged 2 commits into
mainfrom
bug/1994

Conversation

@V3RON

@V3RON V3RON commented Nov 30, 2026 •

Copy link
Copy Markdown
Contributor

Closes #1994

Status

Implement: audit done Review: round 1 at 25beb57, passed Hardware: n/a Gate: not run
Next: finish the PR body, then the gate
Ledger:

  • no findings raised, so there are no entries. I wrote the findings file but did not post the ## Review ledger comment (review-ledger.mjs). The coordinator still has to post it.
    State: {"issue":1994,"branch":"bug/1994","pr":1997,"last":"269d817c5fac","done":"review","mode":"audit","built":1,"audited":true,"assessment":"complete","rounds":["1:25beb57e3fb84e8725b17643875782ac7da51c9a"],"round":"1","commit":"25beb57e3fb84e8725b17643875782ac7da51c9a","checkedBase":"13afddf1697e165cd9ce57164788b4bd8d89e21b","reviewBase":"13afddf1697e165cd9ce57164788b4bd8d89e21b","lenses":3,"findings":"/var/folders/tb/j39z273s5kn7lb9tz1dhk8l00000gn/T/review-1997.g75WzJ/findings.json"}

Done when

  • The two signal tests in src/cli/passthrough.test.ts pass when the tool starts 900 ms late (the startsLate tool and the signalTool helper). — the audit reports 7/7 tests passing in this file at 25beb57 and both tests probed; both spawn the tool through signalTool, whose script starts with startsLate

Assumptions

none

Review

Spec review: 0 blocking, 0 fixed, 0 notes. Code review: 0 blocking, 0 fixed, 0 notes. Claims review: 0 blocking, 0 fixed, 0 notes.
Rounds: 1. Tokens: 0.7M.
Runs: 6. Cost USD: 0.7155. Agent seconds: 403.

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 passthrough signal tests replace fixed waits with a delayed-start child and readiness-file checks. They wait until the child installs its signal handlers before sending signals. The SIGTERM-to-SIGINT test removes the readiness file and checks for exit code 40. Temporary directories are cleaned up after each test.

Severity of issue fixed: Low

Merge Risk: Minimal · up to 25beb

This change only makes two flaky signal tests wait for the child process to be ready instead of using a fixed delay. It does not affect production behavior, and no merge-blocking risk remains.

Pre-merge checks: Passed 4

Check name Status Explanation
Title check Passed The title names the main change: the passthrough signal tests now wait for the tool's ready file before sending signals. It matches the raw summary, which describes readiness files replacing fixed 600…
Description check Passed The description references the linked issue (#1994), states the scope (the two signal tests using the startsLate tool via signalTool), and reports the audit and test results. It is related to the chan…
Linked Issues check Passed [#1994] The issue requires that the two signal tests in src/cli/passthrough.test.ts not fail when the tool starts more than 600 ms late. At head 25beb57, both tests replace the fixed 600 ms wait wit…
Out of Scope Changes check Passed The diff at head compared with the merge base 13afddf changes only src/cli/passthrough.test.ts. The changes are: new imports (existsSync, mkdtempSync, rmSync, tmpdir, join, vi); a `start…
Full details: Title check

Explanation

The title names the main change: the passthrough signal tests now wait for the tool's ready file before sending signals. It matches the raw summary, which describes readiness files replacing fixed 600 ms waits, and the linked issue #1994 about fixed startup delays.

Full details: Description check

Explanation

The description references the linked issue (#1994), states the scope (the two signal tests using the startsLate tool via signalTool), and reports the audit and test results. It is related to the changeset, although it also includes process status notes that are not code changes.

Full details: Linked Issues check

Explanation

[#1994] The issue requires that the two signal tests in src/cli/passthrough.test.ts not fail when the tool starts more than 600 ms late. At head 25beb57, both tests replace the fixed 600 ms wait with untilReady(), a vi.waitFor on a ready file. The tool writes ready only after its SIGINT and SIGTERM handlers are installed, so the signal is sent only after handler installation. The startsLate prefix (Atomics.wait 900 ms) runs before handler setup, so the tests exercise the late-start case by construction. The SIGTERM-to-SIGINT test expects exit code 40 and the SIGINT/stdin test keeps its listener assertions. The test-side change addresses the root cause in the issue. The PR description reports 7/7 tests passing at 25beb57. I did not run the test suite, so the pass result rests on the code inspection and the reported run.

Full details: Out of Scope Changes check

Explanation

The diff at head compared with the merge base 13afddf changes only src/cli/passthrough.test.ts. The changes are: new imports (existsSync, mkdtempSync, rmSync, tmpdir, join, vi); a startsLate delay constant; a signalTool() helper that creates a temp readiness directory and a 15 s orphan guard; readiness waits in the two signal tests; rmSync of the ready file before the signal; and afterEach cleanup of temp dirs. Each change supports the readiness-based waiting required by #1994. The test titles gained a 'when the tool starts late' suffix, which documents the new scenario. No unrelated source or test changes appear in the diff.

  • 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: bafcf322-7f95-4ca7-9a2e-f33ed8602ee6
Commits

Reviewing files that changed from the base of the PR and between 13afddf and 25beb57.

Files selected for processing: 1

  • src/cli/passthrough.test.ts

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

const dir = mkdtempSync(join(tmpdir(), "simlock-passthrough-"));
toolDirs.push(dir);
const ready = join(dir, "ready");
const script = `${startsLate}const fs=require("node:fs");process.on("SIGINT",()=>process.exit(40));process.on("SIGTERM",()=>process.exit(41));fs.writeFileSync(${JSON.stringify(ready)},"");setTimeout(()=>process.exit(1),15000);const poll=setInterval(()=>{if(fs.existsSync(${JSON.stringify(ready)}))return;clearInterval(poll);setTimeout(()=>process.exit(0),200)},20)`;
const dir = mkdtempSync(join(tmpdir(), "simlock-passthrough-"));
toolDirs.push(dir);
const ready = join(dir, "ready");
const script = `${startsLate}const fs=require("node:fs");process.on("SIGINT",()=>process.exit(40));process.on("SIGTERM",()=>process.exit(41));fs.writeFileSync(${JSON.stringify(ready)},"");setTimeout(()=>process.exit(1),15000);const poll=setInterval(()=>{if(fs.existsSync(${JSON.stringify(ready)}))return;clearInterval(poll);setTimeout(()=>process.exit(0),200)},20)`;
@V3RON

V3RON commented Nov 30, 2026

Copy link
Copy Markdown
Contributor Author

Review ledger

Round 1: 25beb57

Runs: 6. Cost USD: 0.7155. Agent seconds: 403.
Tokens input 70, output 17509, cache read 775036, cache write 123774.
- build implementer: claude-sonnet-5-5 78 s $0.1326
- audit implementer: claude-sonnet-5-5 60 s $0.1101
- review 1 reviewer: claude-sonnet-5-5 145 s $0.0797
- review 1 spec: claude-sonnet-5-5 13 s $0.0461
- review 1 code tests: claude-opus-5-5 95 s $0.3068
- review 1 claims: claude-sonnet-5-5 12 s $0.0402
Finding outcomes: {}. Classes: {}.
{"findings":[]}

Written by an agent.

@V3RON
V3RON marked this pull request as ready for review November 30, 2026 16:30
@V3RON
V3RON merged commit 9d3dd59 into main Nov 30, 2026
80 checks passed
@V3RON
V3RON deleted the bug/1994 branch November 30, 2026 16:34
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.

Two signal tests in passthrough.test.ts fail when the tool starts more than 600 ms late

2 participants