File tree Expand file tree Collapse file tree 1 file changed +33
-0
lines changed
Expand file tree Collapse file tree 1 file changed +33
-0
lines changed Original file line number Diff line number Diff line change @@ -11452,6 +11452,39 @@ runs:
1145211452 assert ! ( should_emit_fleet_heartbeat( now, Some ( "not-a-ts" ) , 5 ) ) ;
1145311453 }
1145411454
11455+ #[ test]
11456+ fn fleet_heartbeat_emission_does_not_trigger_for_future_timestamps ( ) {
11457+ let now = OffsetDateTime :: parse (
11458+ "2026-03-01T00:01:00Z" ,
11459+ & time:: format_description:: well_known:: Rfc3339 ,
11460+ )
11461+ . unwrap ( ) ;
11462+ assert ! ( !should_emit_fleet_heartbeat(
11463+ now,
11464+ Some ( "2026-03-01T00:02:30Z" ) ,
11465+ 5 ,
11466+ ) ) ;
11467+ }
11468+
11469+ #[ test]
11470+ fn fleet_heartbeat_emission_with_zero_poll_uses_minimum_interval ( ) {
11471+ let now = OffsetDateTime :: parse (
11472+ "2026-03-01T00:01:00Z" ,
11473+ & time:: format_description:: well_known:: Rfc3339 ,
11474+ )
11475+ . unwrap ( ) ;
11476+ assert ! ( !should_emit_fleet_heartbeat(
11477+ now,
11478+ Some ( "2026-03-01T00:00:31Z" ) ,
11479+ 0 ,
11480+ ) ) ;
11481+ assert ! ( should_emit_fleet_heartbeat(
11482+ now,
11483+ Some ( "2026-03-01T00:00:30Z" ) ,
11484+ 0 ,
11485+ ) ) ;
11486+ }
11487+
1145511488 #[ test]
1145611489 fn fleet_heartbeat_metric_marks_idle_and_active_modes ( ) {
1145711490 let idle = format_fleet_heartbeat_metric ( LoopState :: Running , 10 , 0 , 60 ) ;
You can’t perform that action at this time.
0 commit comments