@@ -337,6 +337,7 @@ async fn bootstrapping_redials_when_all_connections_closed(
337337 let ( bootstrap_peers, mut behaviour) = make_and_connect_bootstrap_nodes ( peer_count) . await ;
338338
339339 close_all_connections ( & mut behaviour, & bootstrap_peers, 0 ) ;
340+ assert_no_event_happens_before_duration ( & mut behaviour, BOOTSTRAP_DIAL_SLEEP_BASE ) . await ;
340341 consume_dial_events ( & mut behaviour, bootstrap_peers. clone ( ) ) . await ;
341342 assert_no_event_happens_before_duration ( & mut behaviour, BOOTSTRAP_DIAL_SLEEP_MAX * 2 ) . await ;
342343}
@@ -374,14 +375,17 @@ async fn bootstrapping_redials_in_accordance_with_strategy_when_all_connections_
374375 assert_no_event_happens_before_duration ( & mut behaviour, BOOTSTRAP_DIAL_SLEEP_MAX * 2 ) . await ;
375376
376377 close_all_connections ( & mut behaviour, & bootstrap_peers, 0 ) ;
378+ assert_no_event_happens_before_duration ( & mut behaviour, BOOTSTRAP_DIAL_SLEEP_BASE ) . await ;
377379 consume_dial_events ( & mut behaviour, bootstrap_peers. clone ( ) ) . await ;
378- assert_no_event_happens_before_duration ( & mut behaviour, BOOTSTRAP_DIAL_SLEEP_MAX * 2 ) . await ;
380+ assert_no_event ( & mut behaviour) ;
379381
380382 for i in 1 ..=NUMBER_OF_DIAL_RETRIES {
381383 fail_all_dial_attempts ( & mut behaviour, & bootstrap_peers) ;
384+ // ConnectionClosed already consumed one strategy step, so iteration `i` of this loop
385+ // observes BOOTSTRAP_DIAL_SLEEP_BASE_MILLIS.pow(i + 1).
382386 let current_retry_duration = min (
383387 BOOTSTRAP_DIAL_SLEEP_MAX ,
384- Duration :: from_millis ( BOOTSTRAP_DIAL_SLEEP_BASE_MILLIS . pow ( i) ) ,
388+ Duration :: from_millis ( BOOTSTRAP_DIAL_SLEEP_BASE_MILLIS . pow ( i + 1 ) ) ,
385389 ) ;
386390 assert_no_event_happens_before_duration ( & mut behaviour, current_retry_duration) . await ;
387391 consume_dial_events ( & mut behaviour, bootstrap_peers. clone ( ) ) . await ;
0 commit comments