Initialize and Update EpochSlots in RepairService (#4255)

* Initialize EpochSlots in RepairService

* Fix flaky test
This commit is contained in:
carllin
2019-05-13 15:37:50 -07:00
committed by GitHub
parent 2eaa64c4e8
commit 7501ed65e5
5 changed files with 247 additions and 15 deletions

View File

@ -364,8 +364,14 @@ mod test {
let leader_schedule_cache = Arc::new(LeaderScheduleCache::new_from_bank(&bank));
let bank_forks = Arc::new(RwLock::new(BankForks::new(0, bank)));
let repair_strategy = RepairStrategy::RepairAll {
bank_forks,
bank_forks: bank_forks.clone(),
completed_slots_receiver,
epoch_schedule: bank_forks
.read()
.unwrap()
.working_bank()
.epoch_schedule()
.clone(),
};
let t_window = WindowService::new(
Some(leader_schedule_cache),
@ -445,9 +451,11 @@ mod test {
let bank = Bank::new(&create_genesis_block_with_leader(100, &me_id, 10).0);
let leader_schedule_cache = Arc::new(LeaderScheduleCache::new_from_bank(&bank));
let bank_forks = Arc::new(RwLock::new(BankForks::new(0, bank)));
let epoch_schedule = *bank_forks.read().unwrap().working_bank().epoch_schedule();
let repair_strategy = RepairStrategy::RepairAll {
bank_forks,
completed_slots_receiver,
epoch_schedule,
};
let t_window = WindowService::new(
Some(leader_schedule_cache),