Skip to content

Commit 1955b7c

Browse files
sourcehawkclaude
andcommitted
test(skills/bounding-heavy-commands): stop a joined line on Ctrl-C after a failed row
No process test covered the case where a row fails and a later row gets the interrupt. The new test runs --measure-rows in a bash line, lets the first row exit 3, interrupts the second, and checks that the wrapper dies from SIGINT and that the next command of the line does not run. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
1 parent 35c3673 commit 1955b7c

1 file changed

Lines changed: 11 additions & 0 deletions

File tree

‎skills/bounding-heavy-commands/scripts/tests/test_bounded_run.py‎

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3066,6 +3066,17 @@ def test_an_interrupt_while_rows_are_measured_stops_the_rows_and_the_line(self):
30663066
self.assertIn("stopped by a signal; the rows after --cpus 2 are not measured", errors)
30673067
self.assertFalse(os.path.exists(marker), "the next command of the line ran")
30683068

3069+
def test_an_interrupt_after_a_failed_row_still_stops_the_line(self):
3070+
marker = os.path.join(self.base.name, "next-ran")
3071+
fail_then_hold = "import os, sys\nif os.environ['BOUNDED_RUN_CPUS'] == '2':\n sys.exit(3)\n" + WORKER
3072+
process = self.line(marker, "touch", ["--measure-rows", "2,1"], [sys.executable, "-c", fail_then_hold, "rows"], HOLD="300")
3073+
self.wait_for_event("start", "rows")
3074+
os.killpg(process.pid, signal.SIGINT)
3075+
self.assertEqual(process.wait(timeout=60), -signal.SIGINT)
3076+
errors = self.stderr_of(process)
3077+
self.assertRegex(errors, r"row label=- cpus=2 .* exit=3")
3078+
self.assertFalse(os.path.exists(marker), "the next command of the line ran")
3079+
30693080
def test_a_command_that_exits_130_by_itself_does_not_stop_the_line(self):
30703081
status = os.path.join(self.base.name, "status")
30713082
process = self.line(status, "echo $? >", ["--memory", "2G"], [sys.executable, "-c", "import sys; sys.exit(130)"])

0 commit comments

Comments
 (0)