From acffb6333bdd928216420c779d6aeb1f8d49f895 Mon Sep 17 00:00:00 2001 From: atlas Date: Thu, 23 Jul 2026 15:32:45 +0200 Subject: [PATCH] test(#2591): update queue tests for Done-nodes-vanish semantics MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Two tests asserted the old behaviour where completed nodes/DAGs stayed in the snapshot. Under the redesign, Done nodes are filtered off the wire (a fully-Done DAG disappears; a Failed one lingers + is history-capped): - failed_node test: the completed reconcile is Done → assert it's absent, not Done-present (its run is already verified by the claim). - history-eviction test: fail the nodes so the DAGs linger (Done ones would vanish), then assert the grace window + per-template cap. --- hive-c0re/src/job_queue/tests.rs | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/hive-c0re/src/job_queue/tests.rs b/hive-c0re/src/job_queue/tests.rs index 6c8a0199..6adac2e9 100644 --- a/hive-c0re/src/job_queue/tests.rs +++ b/hive-c0re/src/job_queue/tests.rs @@ -679,7 +679,12 @@ fn failed_node_cancels_downstream_but_afterany_reconcile_runs() { assert_eq!(by_kind("stop_for_update"), State::Cancelled); assert_eq!(by_kind("swap"), State::Cancelled); assert_eq!(by_kind("post_swap"), State::Cancelled); - assert_eq!(by_kind("reconcile"), State::Done); + // The AfterAny reconcile ran (claimed + completed Ok above) → it's `Done`, + // and `Done` nodes are excluded from the wire, so it's absent here. + assert!( + dag.nodes.iter().all(|n| n.kind != "reconcile"), + "the completed (Done) reconcile is filtered off the wire" + ); assert_eq!( dag.nodes .iter() @@ -917,9 +922,12 @@ fn history_evicts_old_terminals_per_template() { ), ); let c = claim_one(&q); - // Completing the single work node rolls the container up terminal (its - // inline hook fires off the returned summary — no terminal-hook node). - q.complete_node(id, c.node_id, Ok(())); + // Fail the single work node so the DAG *lingers*: a fully-`Done` DAG + // drops off the wire entirely, but a `Failed` one is retained (+ + // history-capped) so the operator can still triage it. Completing the + // node rolls the container up terminal (its inline hook fires off the + // returned summary — no terminal-hook node). + q.complete_node(id, c.node_id, Err("boom".to_owned())); } // Fresh terminals are inside the grace window: nothing evicts yet, // so a ~1s QueueDag poller can still observe every terminal state