Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 11 additions & 1 deletion grovedb/src/tests/test_compaction_sizes.rs
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,17 @@ mod tests {
.expect("cannot read dir")
.filter_map(|entry| entry.ok())
.filter(|entry| entry.path().extension().is_some_and(|ext| ext == extension))
.map(|entry| entry.metadata().unwrap().len())
// Background compaction can delete a file between the read_dir
// listing and the metadata() call; skip vanished files.
.filter_map(|entry| match entry.metadata() {
Ok(metadata) => Some(metadata),
Err(error) if error.kind() == std::io::ErrorKind::NotFound => None,
Err(error) => panic!(
"cannot read metadata for {}: {error}",
entry.path().display()
),
})
.map(|metadata| metadata.len())
Comment thread
coderabbitai[bot] marked this conversation as resolved.
.sum()
}

Expand Down
Loading