diff --git a/bucket_map/src/index_entry.rs b/bucket_map/src/index_entry.rs index 607a0ffb82d2bb..8a5f360ef2312c 100644 --- a/bucket_map/src/index_entry.rs +++ b/bucket_map/src/index_entry.rs @@ -266,7 +266,15 @@ mod tests { let paths: Vec = vec![tmpdir.path().to_path_buf()]; assert!(!paths.is_empty()); - BucketStorage::::new(Arc::new(paths), 1, 1, 1, Arc::default(), Arc::default()) + // `new` here creates a file in `tmpdir`. Once the file is created, `tmpdir` can be dropped without issue. + BucketStorage::::new( + Arc::new(paths), + 1, + std::mem::size_of::() as u64, + 1, + Arc::default(), + Arc::default(), + ) } fn index_entry_for_testing() -> (BucketStorage, IndexEntryPlaceInBucket) {