From 73fba8846846c1dda659108544dbc2ee68d9749e Mon Sep 17 00:00:00 2001 From: Adam Rajfer Date: Fri, 28 Aug 2026 06:23:56 +0200 Subject: [PATCH] fix: preserve batch wrapper exit status Signed-off-by: Adam Rajfer --- benchmarks/nemotron_3.5_super/sbatch_external_vllm.sh | 2 +- tests/unit_tests/test_opensandbox_cleanup.py | 4 +++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/benchmarks/nemotron_3.5_super/sbatch_external_vllm.sh b/benchmarks/nemotron_3.5_super/sbatch_external_vllm.sh index e37612d75a..cbda9c24ab 100644 --- a/benchmarks/nemotron_3.5_super/sbatch_external_vllm.sh +++ b/benchmarks/nemotron_3.5_super/sbatch_external_vllm.sh @@ -285,7 +285,7 @@ main_job_id=$( --comment="$SLURM_COMMENT" \ --exclusive \ --segment=$NUM_NODES \ - --wrap 'exec bash -lc "$batch_command"' + --wrap 'exec bash -c "$batch_command"' ) main_job_id=${main_job_id%%;*} diff --git a/tests/unit_tests/test_opensandbox_cleanup.py b/tests/unit_tests/test_opensandbox_cleanup.py index 2fc1b840e1..5dc9ce4697 100644 --- a/tests/unit_tests/test_opensandbox_cleanup.py +++ b/tests/unit_tests/test_opensandbox_cleanup.py @@ -621,6 +621,8 @@ def test_slurm_launcher_submits_one_dependent_cpu_cleanup_job(tmp_path: Path) -> ] main_call, cleanup_call = read_sbatch_calls(calls_path) assert "--parsable" in main_call + wrap_index = main_call.index("--wrap") + assert main_call[wrap_index + 1] == 'exec bash -c "$batch_command"' submit_dir = str(Path.cwd().resolve()) repo_root = SBATCH_SCRIPT.resolve().parents[2] @@ -698,7 +700,7 @@ def test_slurm_launcher_reports_cleanup_submission_failure(tmp_path: Path) -> No @pytest.mark.parametrize( ("first_step", "eval_status", "expected_status"), - [("eval", 37, 37), ("eval", 143, 143), ("server", 0, 41)], + [("eval", 0, 0), ("eval", 37, 37), ("eval", 143, 143), ("server", 0, 41)], ) def test_slurm_batch_command_preserves_status_and_stops_server( tmp_path: Path, first_step: str, eval_status: int, expected_status: int