MCPcopy Create free account
hub / github.com/cosdata/cosdata / test_random_delete_persistence

Function test_random_delete_persistence

src/models/wal.rs:471–490  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

469
470 #[test]
471 fn test_random_delete_persistence() {
472 let dir = tempdir().unwrap();
473 let version = 0;
474 let id = VectorId::from(random_string(10));
475
476 {
477 let wal = WALFile::new().unwrap();
478 wal.append(VectorOp::Delete(id.clone())).unwrap();
479 wal.flush(dir.as_ref(), VersionNumber::from(version))
480 .unwrap();
481 }
482
483 {
484 let wal = reopen_wal(dir.path(), version);
485 match wal.read().unwrap() {
486 Some(VectorOp::Delete(read_id)) => assert_eq!(read_id, id),
487 _ => panic!("Expected VectorOp::Delete"),
488 }
489 }
490 }
491
492 #[test]
493 fn test_mixed_ops_persistence() {

Callers

nothing calls this directly

Calls 6

reopen_walFunction · 0.85
cloneMethod · 0.80
random_stringFunction · 0.70
appendMethod · 0.45
flushMethod · 0.45
readMethod · 0.45

Tested by

no test coverage detected