Clear the executor at the end of a test by running until it is parked

This commit is contained in:
Max Brunsfeld 2022-02-28 22:20:03 -08:00
parent 426e0e3d4f
commit c09921e790
2 changed files with 2 additions and 1 deletions

View File

@ -174,7 +174,7 @@ impl Deterministic {
}
}
fn run_until_parked(&self) {
pub(crate) fn run_until_parked(&self) {
let woken = Arc::new(AtomicBool::new(false));
self.run_internal(woken, None);
}

View File

@ -84,6 +84,7 @@ pub fn run_test(
)
});
deterministic.run_until_parked();
leak_detector.lock().detect();
if is_last_iteration {
break;