From ea8bcc80ccbb3b7556d226d391189312fdd07321 Mon Sep 17 00:00:00 2001 From: godosa Date: Wed, 7 Oct 2026 19:59:24 +0200 Subject: res: batch gate borrows batch claim; drop queued jobs of dead batch Co-Authored-By: Claude Opus 5.5 Claude-Session: https://claude.ai/code/session_01JEAjUkQRrCYX5MZhWxdtj2 --- tests/test_res_io.py | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'tests/test_res_io.py') diff --git a/tests/test_res_io.py b/tests/test_res_io.py index d91046a..16271e0 100644 --- a/tests/test_res_io.py +++ b/tests/test_res_io.py @@ -426,6 +426,13 @@ class QueueIO(IOBase): self.assertEqual((e.state, e.unit), ("running", "wf-r-2.service")) self.assertEqual(self.box.fake.ran("systemd-run")[-1][-2:], ["sh", "y"]) + def test_batch_gate_borrows_batch_claim(self): + self.box.wf("run", "--mem", "10G", "--for", "40m", "--title", "wf batch", "--", "x") + self.box.caller["WF_RES_ID"] = "r-1" # the gate is queued from inside batch r-1 + code, out, _ = self.box.wf("run", "--mem", "8G", "--for", "10m", "--title", "gate", "--queue", "--", "y") + self.assertEqual((code, out.split(";")[0]), (0, "r-2 started")) + self.assertEqual(self.box.ledger().get("r-2").by["batch"], "r-1") + def test_direct_run_does_not_jump_queue(self): self.box.wf("run", "--mem", "10G", "--for", "40m", "--title", "big", "--", "x") self.box.wf("run", "--mem", "8G", "--for", "10m", "--title", "two", "--queue", "--", "y") -- cgit