Skip to content

Commit a5a499b

Browse files
authored
Merge pull request #149 from dmoliveira/loopmux-br-1jl-regression
Expand cadence and stop-state regression defenses
2 parents 36f4cf1 + 7c0524c commit a5a499b

File tree

1 file changed

+19
-0
lines changed

1 file changed

+19
-0
lines changed

src/main.rs

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11455,6 +11455,9 @@ runs:
1145511455
assert!(active.contains("activity=active"));
1145611456
assert!(active.contains("sends_total=12"));
1145711457
assert!(active.contains("sends_delta=2"));
11458+
let stopped = format_fleet_heartbeat_metric(LoopState::Stopped, 12, 0, 60);
11459+
assert!(stopped.contains("state=stopped"));
11460+
assert!(stopped.contains("activity=idle"));
1145811461
}
1145911462

1146011463
#[test]
@@ -11981,6 +11984,22 @@ runs:
1198111984
assert!(plan.break_wait);
1198211985
}
1198311986

11987+
#[test]
11988+
fn plan_hold_action_pause_while_holding_is_stable() {
11989+
let plan = plan_hold_action(TuiAction::Pause, true, true).unwrap();
11990+
assert_eq!(plan.transition, HoldTransition::Unchanged);
11991+
assert!(!plan.force_rescan);
11992+
assert!(!plan.break_wait);
11993+
}
11994+
11995+
#[test]
11996+
fn plan_hold_action_toggle_entering_hold_does_not_force_rescan() {
11997+
let plan = plan_hold_action(TuiAction::HoldToggle, false, true).unwrap();
11998+
assert_eq!(plan.transition, HoldTransition::EnterHolding);
11999+
assert!(!plan.force_rescan);
12000+
assert!(!plan.break_wait);
12001+
}
12002+
1198412003
#[test]
1198512004
fn apply_hold_transition_updates_state_consistently() {
1198612005
let mut loop_state = LoopState::Running;

0 commit comments

Comments
 (0)