MCPcopy Create free account
hub / github.com/NodeDB-Lab/nodedb / recover_empty_wal

Function recover_empty_wal

nodedb-wal/src/recovery.rs:98–112  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

96
97 #[test]
98 fn recover_empty_wal() {
99 let dir = tempfile::tempdir().unwrap();
100 let path = dir.path().join("empty.wal");
101
102 // Create empty WAL.
103 {
104 let mut writer = WalWriter::open_without_direct_io(&path).unwrap();
105 writer.sync().unwrap();
106 }
107
108 let info = recover(&path).unwrap();
109 assert_eq!(info.last_lsn, 0);
110 assert_eq!(info.record_count, 0);
111 assert_eq!(info.next_lsn(), 1);
112 }
113
114 #[test]
115 fn recover_nonexistent_file() {

Callers

nothing calls this directly

Calls 4

recoverFunction · 0.85
joinMethod · 0.80
pathMethod · 0.45
syncMethod · 0.45

Tested by

no test coverage detected