@@ -2339,6 +2339,7 @@ async fn test_preingestion_time_sync_ok(
23392339 . into_inner ( ) ;
23402340
23412341 let addr = response. address . as_str ( ) ;
2342+ let ip_addr = IpAddr :: from_str ( addr) . unwrap ( ) ;
23422343 // Insert endpoint with current versions that are up to date
23432344 insert_endpoint_version ( & mut txn, addr, "6.00.30.00" , "1.13.2" , false ) . await ?;
23442345 txn. commit ( ) . await ?;
@@ -2349,6 +2350,8 @@ async fn test_preingestion_time_sync_ok(
23492350 // then check firmware and complete.
23502351 mgr. run_single_iteration ( ) . await ?;
23512352
2353+ // Second iteration applies site NTP servers and records when that
2354+ // succeeded, but does not check BMC time until the convergence wait elapses.
23522355 mgr. run_single_iteration ( ) . await ?;
23532356
23542357 let actions = env. redfish_sim . actions_since ( & timepoint) ;
@@ -2360,6 +2363,36 @@ async fn test_preingestion_time_sync_ok(
23602363 "Expected SetNtpServers when site NTP is configured"
23612364 ) ;
23622365
2366+ let mut txn = pool. begin ( ) . await . unwrap ( ) ;
2367+ let endpoints = db:: explored_endpoints:: find_all_by_ip ( ip_addr, & mut txn) . await ?;
2368+ let endpoint = endpoints. first ( ) . expect ( "Endpoint should exist" ) ;
2369+ assert ! (
2370+ matches!(
2371+ endpoint. preingestion_state,
2372+ PreingestionState :: SetNtpServers {
2373+ set_at: Some ( _) ,
2374+ attempts: 0
2375+ }
2376+ ) ,
2377+ "Expected SetNtpServers wait after applying NTP, got: {:?}" ,
2378+ endpoint. preingestion_state
2379+ ) ;
2380+ txn. commit ( ) . await ?;
2381+
2382+ // The next iteration should still wait for BMC NTP convergence.
2383+ mgr. run_single_iteration ( ) . await ?;
2384+
2385+ let mut txn = pool. begin ( ) . await . unwrap ( ) ;
2386+ db:: explored_endpoints:: set_preingestion_set_ntp_servers (
2387+ ip_addr,
2388+ Some ( chrono:: Utc :: now ( ) - chrono:: TimeDelta :: minutes ( 3 ) ) ,
2389+ 0 ,
2390+ & mut txn,
2391+ )
2392+ . await ?;
2393+ txn. commit ( ) . await ?;
2394+
2395+ // Once the convergence wait has elapsed, time sync and firmware checks complete.
23632396 mgr. run_single_iteration ( ) . await ?;
23642397
23652398 let mut txn = pool. begin ( ) . await . unwrap ( ) ;
0 commit comments