From d52571ccb0dfb21f685e16ff4551231490fc4737 Mon Sep 17 00:00:00 2001 From: jeff washington Date: Wed, 29 Mar 2023 09:51:29 -0500 Subject: [PATCH] fix and comment index_bucket_for_testing --- bucket_map/src/index_entry.rs | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) 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) {