Skip to content

Commit

Permalink
Fix flaky test_cleanup_intermediate_files (#5645)
Browse files Browse the repository at this point in the history
  • Loading branch information
tustvold committed Apr 15, 2024
1 parent 8731760 commit 0124307
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions object_store/src/local.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1450,10 +1450,14 @@ mod not_wasm_tests {
assert_eq!(file_count, 1);
drop(upload);

tokio::time::sleep(Duration::from_millis(1)).await;

let file_count = std::fs::read_dir(root.path()).unwrap().count();
assert_eq!(file_count, 0);
for _ in 0..100 {
tokio::time::sleep(Duration::from_millis(1)).await;
let file_count = std::fs::read_dir(root.path()).unwrap().count();
if file_count == 0 {
return;
}
}
panic!("Failed to cleanup file in 100ms")
}
}

Expand Down

0 comments on commit 0124307

Please sign in to comment.