Skip to content

Commit 5fcc183

Browse files
sourcehawkclaude
andcommitted
fix(skills/bounding-heavy-commands): keep the first failed exit code when a stop signal ends the rows
The usage text and the skill say that the exit code of --measure-rows is the first exit code of a row that is not 0. When a row failed and a later row was stopped by a signal, the wrapper returned the code of the stop. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
1 parent a54f8bb commit 5fcc183

2 files changed

Lines changed: 6 additions & 1 deletion

File tree

‎skills/bounding-heavy-commands/scripts/bounded_run.py‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1013,7 +1013,7 @@ def bounded(options: Options, environ: Mapping[str, str]) -> int:
10131013
code, suggested = bounded_once(row, environ)
10141014
if code in STOP_CODES:
10151015
log("stopped by a signal; the rows after --cpus %d are not measured" % cpus)
1016-
return code
1016+
return result or code
10171017
if code == 0:
10181018
memory = "%dM" % suggested
10191019
else:

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

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1765,6 +1765,11 @@ def test_a_row_that_a_stop_signal_ended_ends_the_rows(self):
17651765
self.assertEqual(self.runs, [(8, 8192), (4, 1536)])
17661766
self.assertEqual(len(self.row_lines()), 2)
17671767

1768+
def test_a_stop_signal_after_a_failed_row_keeps_the_first_exit_code(self):
1769+
code = self.run_bounded(["--measure-rows", "8,4,2"], [(1, 1000), (130, 100), (0, 100)])
1770+
self.assertEqual(code, 1)
1771+
self.assertEqual(len(self.runs), 2)
1772+
17681773

17691774
class WrapperProcessCase(unittest.TestCase):
17701775
"""Runs the script as a process, with two slots of 2 GiB and no hard cap."""

0 commit comments

Comments
 (0)