Flows and dashboards are created by POST under an issued or superuser-pinned id; PUT only updates; deleted flows leave a tombstone with their key; the controller stores by id and runs by key, hooks live under /hooks/<flow id>; a key with state or queued work behind it is refused until cleared

This commit is contained in:
2026-11-02 17:41:23 +01:00
parent fae85f5ecb
commit 08a6376836
63 changed files with 2832 additions and 936 deletions
+27
View File
@@ -66,3 +66,30 @@ def test_a_refused_stream_write_keeps_the_timer_for_retry(queue):
assert queue.move_due(200.0) == 1
assert queue.move_due(200.0) == 0
assert [item.node for item in queue.claim(10, 10, due_only=True)] == ["f.stop"]
def test_clearing_a_flow_drops_its_queued_claimed_and_held_work(queue):
queue.add(WorkItem(kind="cascade", node="gone.p", flow="gone"))
(claimed,) = queue.claim(1, 10)
assert claimed.node == "gone.p"
queue.add(WorkItem(kind="cascade", node="gone.a", flow="gone"))
queue.add(
WorkItem(kind="cascade", node="kept.a", flow="kept", outputs={"gone.x": 1})
)
queue.add(WorkItem(kind="run", node="", flow="gone", run_id="r1"))
queue.add_delayed(WorkItem(kind="flush", node="gone.b", flow="gone"), 9e9)
queue.add_delayed(WorkItem(kind="flush", node="kept.b", flow="kept"), 9e9)
queue.park("gone", WorkItem(kind="cascade", node="gone.c", flow="gone"))
assert len(queue.live_items()) == 7
queue.clear_flow("gone")
assert sorted((i.kind, i.node) for i in queue.live_items()) == [
("cascade", "kept.a"),
("flush", "kept.b"),
("run", ""),
]
# Nothing comes back to be run again: not redelivered, not reclaimed.
assert queue.reclaim_stale(0) == []
queue.ack(claimed)
assert [i.node for i in queue.claim(10, 10)] == ["kept.a", ""]