This is an automated email from the ASF dual-hosted git repository.
tustvold pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/arrow-rs.git
The following commit(s) were added to refs/heads/master by this push:
new 012430759f3 Fix flaky test_cleanup_intermediate_files (#5645)
012430759f3 is described below
commit 012430759f319f24d84593bee1769f6f6051abed
Author: Raphael Taylor-Davies <[email protected]>
AuthorDate: Mon Apr 15 15:17:58 2024 +0100
Fix flaky test_cleanup_intermediate_files (#5645)
---
object_store/src/local.rs | 12 ++++++++----
1 file changed, 8 insertions(+), 4 deletions(-)
diff --git a/object_store/src/local.rs b/object_store/src/local.rs
index 0d7c279b319..d5581cdc8f5 100644
--- a/object_store/src/local.rs
+++ b/object_store/src/local.rs
@@ -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")
}
}