Skip to content

Commit b676a0b

Browse files
pimpinclaude
andcommitted
Add local database cleanup in resurrection test setup
Ensure tombstone_resurrection_test starts with a clean local database by deleting any existing database from previous runs. This prevents interference from previous test data and ensures reproducible results. Changes: - Check if database exists before opening - Delete existing database if found - Log cleanup action for transparency This is critical for the resurrection test scenario where we need to control exactly when the document is created with its updatedAt timestamp. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <[email protected]>
1 parent 7ad96fb commit b676a0b

File tree

1 file changed

+12
-2
lines changed

1 file changed

+12
-2
lines changed

examples/tombstone_resurrection_test.rs

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -47,10 +47,20 @@ fn main() {
4747
get_metadata_purge_interval();
4848
reporter.log("");
4949

50+
// SETUP: Clean up local database from previous run
51+
let db_name = "tombstone_resurrection_test";
52+
let db_path = Path::new("./");
53+
54+
if Database::exists(db_name, db_path) {
55+
reporter.log("SETUP: Deleting local database from previous run...");
56+
Database::delete_file(db_name, db_path).expect("Failed to delete existing database");
57+
reporter.log("✓ Local database cleaned\n");
58+
}
59+
5060
let mut db_cblite = Database::open(
51-
"tombstone_resurrection_test",
61+
db_name,
5262
Some(DatabaseConfiguration {
53-
directory: Path::new("./"),
63+
directory: db_path,
5464
#[cfg(feature = "enterprise")]
5565
encryption_key: None,
5666
}),

0 commit comments

Comments
 (0)