From 0a8a0ea06045524dbaf7ebcf34793d0155ba201e Mon Sep 17 00:00:00 2001 From: Wen <113942165+wen-coding@users.noreply.github.com> Date: Tue, 10 Sep 2024 19:10:38 -0700 Subject: [PATCH] Fix flaky unittest, should use timestamp of the Gossip message. (#2893) --- wen-restart/src/last_voted_fork_slots_aggregate.rs | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/wen-restart/src/last_voted_fork_slots_aggregate.rs b/wen-restart/src/last_voted_fork_slots_aggregate.rs index fade1354a93b39..970cc706d56f34 100644 --- a/wen-restart/src/last_voted_fork_slots_aggregate.rs +++ b/wen-restart/src/last_voted_fork_slots_aggregate.rs @@ -490,9 +490,10 @@ mod tests { [initial_num_active_validators + 2] .node_keypair .pubkey(); + let now = timestamp(); let super_old_validator_last_voted_slots = RestartLastVotedForkSlots::new( super_old_validator, - timestamp(), + now, &[root_slot - 1], Hash::default(), SHRED_VERSION, @@ -506,7 +507,7 @@ mod tests { last_voted_fork_slots: vec![], last_vote_bankhash: Hash::default().to_string(), shred_version: SHRED_VERSION as u32, - wallclock: timestamp(), + wallclock: now, }), ); assert_eq!(