aboutsummaryrefslogtreecommitdiffziptar.gz
path: root/tests/test_res_io.py
diff options
context:
space:
mode:
Diffstat (limited to 'tests/test_res_io.py')
-rw-r--r--tests/test_res_io.py7
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")