Fix flaky broadcast test (#14329)

This commit is contained in:
sakridge
2020-12-29 12:35:04 -08:00
committed by GitHub
parent 2074e407cd
commit f8a4afc7c1

View File

@ -666,8 +666,6 @@ pub mod test {
} }
} }
sleep(Duration::from_millis(2000));
trace!( trace!(
"[broadcast_ledger] max_tick_height: {}, start_tick_height: {}, ticks_per_slot: {}", "[broadcast_ledger] max_tick_height: {}, start_tick_height: {}, ticks_per_slot: {}",
max_tick_height, max_tick_height,
@ -675,10 +673,17 @@ pub mod test {
ticks_per_slot, ticks_per_slot,
); );
let blockstore = broadcast_service.blockstore; let mut entries = vec![];
let entries = blockstore for _ in 0..10 {
.get_slot_entries(slot, 0) entries = broadcast_service
.expect("Expect entries to be present"); .blockstore
.get_slot_entries(slot, 0)
.expect("Expect entries to be present");
if entries.len() >= max_tick_height as usize {
break;
}
sleep(Duration::from_millis(1000));
}
assert_eq!(entries.len(), max_tick_height as usize); assert_eq!(entries.len(), max_tick_height as usize);
drop(entry_sender); drop(entry_sender);