diff options
| author | godosa <godosa@godosa.eu> | 2026-10-07 19:59:24 +0200 |
|---|---|---|
| committer | godosa <godosa@godosa.eu> | 2026-10-07 19:59:24 +0200 |
| commit | ea8bcc80ccbb3b7556d226d391189312fdd07321 (patch) | |
| tree | 723e92b5c5d8d39f96c51942ee7d93094d3e360f /tests/test_res_io.py | |
| parent | e6f7306c472a7589d08f4098e476d54bffd1f761 (diff) | |
| download | workflow-ea8bcc80ccbb3b7556d226d391189312fdd07321.tar.gz workflow-ea8bcc80ccbb3b7556d226d391189312fdd07321.zip | |
res: batch gate borrows batch claim; drop queued jobs of dead batch
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01JEAjUkQRrCYX5MZhWxdtj2
Diffstat (limited to 'tests/test_res_io.py')
| -rw-r--r-- | tests/test_res_io.py | 7 |
1 files changed, 7 insertions, 0 deletions
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") |
