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

Function gc_propagates_snapshot_error

nodedb-array/src/sync/gc.rs:261–278  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

259
260 #[test]
261 fn gc_propagates_snapshot_error() {
262 let log = InMemoryOpLog::new();
263 log.append(&make_op("arr", 10)).unwrap();
264
265 let mut acks = AckVector::new();
266 acks.record(replica(), hlc(50));
267
268 let sink = MockSnapshotSink::new();
269 let result = collapse_below(&log, &acks, &sink, |_, _| {
270 Err(ArrayError::SegmentCorruption {
271 detail: "simulated snapshot error".into(),
272 })
273 });
274
275 assert!(result.is_err());
276 // Log must be unchanged.
277 assert_eq!(log.len().unwrap(), 1);
278 }
279
280 #[test]
281 fn gc_min_ack_with_two_replicas() {

Callers

nothing calls this directly

Calls 6

collapse_belowFunction · 0.85
make_opFunction · 0.70
replicaFunction · 0.70
hlcFunction · 0.70
appendMethod · 0.45
recordMethod · 0.45

Tested by

no test coverage detected