| 335 | |
| 336 | #[test] |
| 337 | fn test_durability() { |
| 338 | let dir = tempdir().unwrap(); |
| 339 | let version = 0; |
| 340 | let id = VectorId::from("test_id".to_string()); |
| 341 | |
| 342 | { |
| 343 | let mut wal = DurableWALFile::new(dir.path(), VersionNumber::from(version)).unwrap(); |
| 344 | wal.append(VectorOp::Delete(id.clone())).unwrap(); |
| 345 | // No explicit flush, but append should flush |
| 346 | } |
| 347 | |
| 348 | // Reopen should still see the data |
| 349 | let wal = WALFile::from_existing(dir.path(), VersionNumber::from(version)); |
| 350 | assert!(wal.is_ok()); |
| 351 | } |
| 352 | } |