Let a sweep run more than four at a time, and name the run a failure was in

Concurrent runs sat at 4 whatever FLOW_MAX_CASCADES said: that setting bounds
cascades, and the run drivers read a hardcoded MAX_PARALLEL nobody could reach.
FLOW_MAX_RUNS is the knob they read now, --max-runs/--max-cascades/--max-workers
are the same three as flags on serve, and the engine says which numbers it
started with — which is the only way to tell that a settings file was read.

Events keep the run they happened in. The payload always carried it and the
persist path dropped it, so reading one run's failures meant filtering the
engine-wide list; a batch run's id reaches those events now too, since a run
has no journaled item to name itself by.

Also: a provisioner's 0 means "no deadline" rather than "cancel on the next
reconcile", and a command that reaches no engine says how to start one.
This commit is contained in:
2026-08-27 14:17:51 +02:00
parent 2c081fe3ed
commit 081d499edc
23 changed files with 288 additions and 18 deletions
+19 -2
View File
@@ -8,6 +8,7 @@ it should, and that a job nobody ever attached does not sit in the queue.
import subprocess
import threading
import time
from fluksio.flow.placement import Placer
from fluksio.flow.provision import SlurmProfile, SlurmProvisioner, load_provisioners
@@ -116,6 +117,22 @@ def test_a_machine_that_arrives_clears_the_way_for_the_next_ask(monkeypatch):
def test_a_job_that_never_attaches_is_cancelled(monkeypatch):
ssh = FakeSsh()
monkeypatch.setattr(subprocess, "run", ssh)
hpc = cluster(provision_timeout_s=0.01)
hpc.provision(cpus=2, gpus=0, ram_mb=0)
assert ssh.ran.wait(5)
# Slept rather than set to zero: zero is what says "no deadline" now.
time.sleep(0.02)
hpc.reconcile(set())
assert hpc.status()["outstanding"] == []
assert ["scancel", "4711"] == ssh.calls[-1][0][-2:]
def test_no_deadline_waits_for_as_long_as_the_queue_does(monkeypatch):
"""0 is "never give up", not "give up now": a cluster can queue for days."""
ssh = FakeSsh()
monkeypatch.setattr(subprocess, "run", ssh)
hpc = cluster(provision_timeout_s=0)
@@ -124,8 +141,8 @@ def test_a_job_that_never_attaches_is_cancelled(monkeypatch):
assert ssh.ran.wait(5)
hpc.reconcile(set())
assert hpc.status()["outstanding"] == []
assert ["scancel", "4711"] == ssh.calls[-1][0][-2:]
assert hpc.status()["outstanding"][0]["job"] == "4711"
assert [argv for argv, _ in ssh.calls if "scancel" in argv] == []
def test_a_refused_submission_says_what_the_cluster_said(monkeypatch):