Make compaction transitions recoverable
This commit is contained in:
@@ -196,7 +196,14 @@ mod tests {
|
||||
let directory =
|
||||
std::env::temp_dir().join(format!("ds4-server-sweep-{}", std::process::id()));
|
||||
std::fs::create_dir_all(&directory).unwrap();
|
||||
for name in ["1.bin", "2.bin", "notes.bin", "7.bin"] {
|
||||
for name in [
|
||||
"1.bin",
|
||||
"2.bin",
|
||||
"notes.bin",
|
||||
"7.bin",
|
||||
"1.compacting",
|
||||
"2.tmp",
|
||||
] {
|
||||
std::fs::write(directory.join(name), b"payload").unwrap();
|
||||
}
|
||||
let projects = vec![ProjectWithSessions {
|
||||
@@ -213,6 +220,8 @@ mod tests {
|
||||
// Not a session checkpoint, so not ours to delete.
|
||||
assert!(directory.join("notes.bin").exists());
|
||||
assert!(!directory.join("7.bin").exists());
|
||||
assert!(!directory.join("1.compacting").exists());
|
||||
assert!(!directory.join("2.tmp").exists());
|
||||
// Nothing left to sweep on the next pass.
|
||||
assert!(!super::super::sweep_orphan_checkpoints(
|
||||
&directory, &projects
|
||||
|
||||
Reference in New Issue
Block a user