test(#2591): update queue tests for Done-nodes-vanish semantics
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.
This commit is contained in:
parent
33c3fb3b34
commit
acffb6333b
1 changed files with 12 additions and 4 deletions
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Reference in a new issue