Skip to content

Commit

Permalink
rename, add assert detecting time out
Browse files Browse the repository at this point in the history
  • Loading branch information
jeffwashington committed Sep 2, 2021
1 parent fe4e013 commit 830eea8
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions runtime/src/bank.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12976,21 +12976,22 @@ pub(crate) mod tests {
// Let threads run for a while, check the scans didn't see any mixed slots
let min_expected_number_of_scans = 5;
std::thread::sleep(Duration::new(5, 0));
let mut loops = 1000;
let mut remaining_loops = 1000;
loop {
if num_banks_scanned.load(Relaxed) > min_expected_number_of_scans {
break;
} else {
std::thread::sleep(Duration::from_millis(100));
}
loops -= 1;
if loops == 0 {
remaining_loops -= 1;
if remaining_loops == 0 {
break; // just quit and try to get the thread result (panic, etc.)
}
}
exit.store(true, Relaxed);
scan_thread.join().unwrap();
update_thread.join().unwrap();
assert!(remaining_loops > 0, "test timed out");
}

#[test]
Expand Down

0 comments on commit 830eea8

Please sign in to comment.