Skip to content

fix(test): the SIGKILL escalation test no longer passes without SIGKILL - #1995

Merged
V3RON merged 3 commits into
mainfrom
bug/1986
Nov 30, 2026
Merged

V3RON merged 3 commits into
mainfrom
bug/1986

Conversation

@V3RON

@V3RON V3RON commented Nov 30, 2026 •

Copy link
Copy Markdown
Contributor

Closes #1986

Status

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

  • R1, from code, fixed. The fix commit is b8d5d16, and the code/tests lens verified it at the same SHA. Impact is test-logic. In src/ports/process-runner.test.ts the grace moves from 100 to 250 and the advance from 99 to 249. The lens ran four mutants against src/ports/node-process-runner.ts:
  • Grace timer set to options.timeoutMs: the test fails. I saw the same result in my own mutation.
  • Grace timer set to sigkillGraceMs + 1: the test fails.
  • Grace measured from launch: the test fails.
  • Deadline timer set to this.sigkillGraceMs: 5 tests fail.
  • The unmodified run passes all 46 tests. No sibling test conflates the grace with the timeout.
    State: {"issue":1986,"branch":"bug/1986","pr":1995,"last":"ce1d1fa08a57","done":"gate","mode":"fix","built":1,"audited":true,"assessment":"complete","rounds":["1:87a57b4ab4f8ae5424fb6742bf4785284ac13c93","2:b8d5d16b6ccbbae30988ce520a00c16f79bf74d1"],"round":"2","commit":"b8d5d16b6ccbbae30988ce520a00c16f79bf74d1","checkedBase":"13afddf1697e165cd9ce57164788b4bd8d89e21b","reviewBase":"13afddf1697e165cd9ce57164788b4bd8d89e21b","lenses":1,"findings":"/var/folders/tb/j39z273s5kn7lb9tz1dhk8l00000gn/T/review-1995.nCzuqQ/findings.json","gate":{"red":1,"fixes":0,"refusal":"not merged: CI not green on PR fix(test): the SIGKILL escalation test no longer passes without SIGKILL #1995: fail Quality;cancel Swift tests;","merged":null},"unknown":["job Quality (CI run 46461848563)"]}

Done when

  • The SIGKILL escalation test fails when the runner sends no SIGKILL, however late the child starts (test change in src/ports/process-runner.test.ts). — audit removed the SIGKILL at 87a57b4: the test failed on signal: 'SIGKILL'; b8d5d16 changes only the durations. The clock starts after the child logs ready, so start time does not matter; triage passed the same design with children 0, 300 and 3000 ms late.

Assumptions

none

Review

Spec review: 0 blocking, 0 fixed, 0 notes. Code review: 1 blocking, 1 fixed, 0 notes. Claims review: 0 blocking, 0 fixed, 0 notes.
Rounds: 2. Tokens: 1.2M.
Runs: 9. Cost USD: 1.3009. Agent seconds: 803.

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 process runner tests add polling that uses a captured real setTimeout, plus a helper that reads UTF-8 log contents and returns an empty string if reading fails. The SIGKILL escalation test now runs only on non-Windows platforms. It uses a child process and fake timers to verify that SIGTERM is sent first and SIGKILL follows at the configured grace-period boundary.

Suggested reviewers: miospotdevteam, leonardoxr

Severity of issue fixed: Low

Merge Risk: Minimal · up to b8d5d

This change only tightens a test so it fails when SIGKILL escalation is missing. It does not change runtime behavior, and no concrete merge risk remains.

Pre-merge checks: Passed 3 · Inconclusive 1

Failed Failed checks: 1 inconclusive

Check name Status Explanation Resolution
Linked Issues check Inconclusive [#1986] Requirement: the SIGKILL escalation test in src/ports/process-runner.test.ts must detect a runner that sends no SIGKILL, including when the child starts late. The PR summary and raw summary … Provide readable evidence of the named test body at reviewedHead (for example, a diff of src/ports/process-runner.test.ts against the merge base, or a readable file range that includes the SIGKILL escalation test). Confirm that the test…
Passed Passed checks: 3 passed

Check name Status Explanation
Title check Passed The title names the main change: the SIGKILL escalation test is fixed so it no longer passes when the runner sends no SIGKILL. The raw summary and objectives confirm the change in src/ports/process-ru…
Out of Scope Changes check Passed The PR summary and raw summary state that all changes are in src/ports/process-runner.test.ts (+56/-28). The visible head content shows test helpers: waitUntil polls on a captured real `setTimeout…
Description check Passed The description is related to the changeset. It names the SIGKILL escalation test in src/ports/process-runner.test.ts, explains the grace change from 100 ms to 250 ms and the advance from 99 ms to 249…
Full details: Title check

Explanation

The title names the main change: the SIGKILL escalation test is fixed so it no longer passes when the runner sends no SIGKILL. The raw summary and objectives confirm the change in src/ports/process-runner.test.ts (grace 100 to 250 ms, clock starts after child readiness). The title is specific and accurate, though it is slightly long at 71 characters.

Full details: Out of Scope Changes check

Explanation

The PR summary and raw summary state that all changes are in src/ports/process-runner.test.ts (+56/-28). The visible head content shows test helpers: waitUntil polls on a captured real setTimeout so that polling works under fake timers, and readLog reads a child's log file. The SIGKILL test uses fake timers and reads its log, so these helpers support the target test. No change to src/ports/node-process-runner.ts or other production code is reported. The changed test body could not be read, so this verdict rests on the reported file scope and the helper changes.

Full details: Description check

Explanation

The description is related to the changeset. It names the SIGKILL escalation test in src/ports/process-runner.test.ts, explains the grace change from 100 ms to 250 ms and the advance from 99 ms to 249 ms, and links issue #1986. Its ledger and mutation results also match the changed test logic. The description is not off-topic, so it passes this lenient check.

Full details: Linked Issues check

Explanation

[#1986] Requirement: the SIGKILL escalation test in src/ports/process-runner.test.ts must detect a runner that sends no SIGKILL, including when the child starts late. The PR summary and raw summary describe the fix: the clock starts after the child reports readiness, the grace is 250 ms, the test checks that only SIGTERM was sent at 249 ms, then advances 1 ms and expects SIGKILL. The reviewed head file confirms the waitUntil change (captured realSetTimeout) and the readLog helper. The named test body lies beyond the 16000-byte read limit, so its assertions are not verified. The whole-PR diff could not be read: the changed blobs are missing from the checkout. The mutation results in the PR description are self-reported and were not reproduced. Because the test's assertions cannot be read, I cannot confirm that it fails without SIGKILL.

Resolution

Provide readable evidence of the named test body at reviewedHead (for example, a diff of src/ports/process-runner.test.ts against the merge base, or a readable file range that includes the SIGKILL escalation test). Confirm that the test asserts signal: 'SIGKILL' after the 250 ms grace advance, and that its clock starts after the child's ready signal.

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: 0f0d8d47-f257-4858-975f-14fbcfb1d21a
Commits

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

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; 3 remain after this review.

process.execPath,
[
"-e",
`const fs = require("node:fs"); process.on("SIGTERM", () => fs.appendFileSync(${JSON.stringify(log)}, " SIGTERM")); setInterval(() => {}, 1_000); setTimeout(() => process.exit(0), 4_000); fs.appendFileSync(${JSON.stringify(log)}, "ready")`,
process.execPath,
[
"-e",
`const fs = require("node:fs"); process.on("SIGTERM", () => fs.appendFileSync(${JSON.stringify(log)}, " SIGTERM")); setInterval(() => {}, 1_000); setTimeout(() => process.exit(0), 4_000); fs.appendFileSync(${JSON.stringify(log)}, "ready")`,
@V3RON

V3RON commented Nov 30, 2026 •

Copy link
Copy Markdown
Contributor Author

Review ledger

Round 1: 87a57b4
Round 2: b8d5d16

Runs: 9. Cost USD: 1.3009. Agent seconds: 803.
Tokens input 139, output 27070, cache read 1493900, cache write 218674.
- build implementer: claude-sonnet-5-5 117 s $0.1406
- audit implementer: claude-sonnet-5-5 42 s $0.1042
- review 1 reviewer: claude-sonnet-5-5 172 s $0.0849
- review 1 spec: claude-sonnet-5-5 11 s $0.0596
- review 1 code tests: claude-opus-5-5 119 s $0.3899
- review 1 claims: claude-sonnet-5-5 17 s $0.054
- fix 1 implementer: claude-sonnet-5-5 41 s $0.0789
- review 2 reviewer: claude-sonnet-5-5 205 s $0.1111
- review 2 code tests: claude-opus-5-5 79 s $0.2777
Finding outcomes: {"fixed":1}. Classes: {"testing 2":1}.
{"findings":[{"id":"R1","role":"code","class":"testing 2","outcome":"fixed","path":"src/ports/process-runner.test.ts:825","round":"1","detail":"mutation survives, grace equals timeout","fix":"b8d5d16b6ccbbae30988ce520a00c16f79bf74d1"}]}

Written by an agent.

@V3RON
V3RON marked this pull request as ready for review November 30, 2026 16:30
@V3RON
V3RON merged commit f3410e3 into main Nov 30, 2026
110 of 114 checks passed
@V3RON
V3RON deleted the bug/1986 branch November 30, 2026 17:01
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.

The SIGKILL escalation test passes without escalation when its child starts later than 100 ms

2 participants