@@ -1008,6 +1008,8 @@ fn test_nakamoto_inv_sync_across_epoch_change() {
1008
1008
. block_height_to_reward_cycle ( tip. block_height )
1009
1009
. unwrap ( ) ;
1010
1010
1011
+ let timeout = std:: time:: Duration :: from_secs ( 30 ) ;
1012
+ let start = std:: time:: Instant :: now ( ) ;
1011
1013
// run peer and other_peer until they connect
1012
1014
loop {
1013
1015
let _ = peer. step_with_ibd ( false ) ;
@@ -1019,6 +1021,10 @@ fn test_nakamoto_inv_sync_across_epoch_change() {
1019
1021
if event_ids. count ( ) > 0 && other_event_ids. count ( ) > 0 {
1020
1022
break ;
1021
1023
}
1024
+ assert ! (
1025
+ start. elapsed( ) < timeout,
1026
+ "Timed out waiting for peer's to connect"
1027
+ ) ;
1022
1028
}
1023
1029
1024
1030
debug ! ( "Peers are connected" ) ;
@@ -1036,6 +1042,7 @@ fn test_nakamoto_inv_sync_across_epoch_change() {
1036
1042
1037
1043
let burn_tip_start = peer. network . get_current_epoch ( ) . start_height ;
1038
1044
1045
+ let start = std:: time:: Instant :: now ( ) ;
1039
1046
while inv_1_count < num_epoch2_blocks
1040
1047
|| inv_2_count < num_epoch2_blocks
1041
1048
|| highest_rc_1 < total_rcs
@@ -1098,6 +1105,11 @@ fn test_nakamoto_inv_sync_across_epoch_change() {
1098
1105
info ! (
1099
1106
"Nakamoto state machine: Peer 1: {highest_rc_1}, Peer 2: {highest_rc_2} (total {total_rcs})"
1100
1107
) ;
1108
+
1109
+ assert ! (
1110
+ start. elapsed( ) < timeout,
1111
+ "Timed out waiting for inv sync across epoch. Ran {round} rounds."
1112
+ ) ;
1101
1113
}
1102
1114
}
1103
1115
0 commit comments