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

Function ack_vector_watermark_is_monotonic

nodedb/tests/array_sync_gc.rs:288–303  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

286/// `AckVector` records are monotonic: a lower HLC cannot regress the watermark.
287#[test]
288fn ack_vector_watermark_is_monotonic() {
289 let mut acks = AckVector::new();
290 let h50 = hlc(50, 1);
291 let h100 = hlc(100, 1);
292 let h30 = hlc(30, 1);
293
294 acks.record(rep(1), h100);
295 acks.record(rep(1), h30); // must not regress
296 acks.record(rep(1), h50); // still below h100
297
298 assert_eq!(
299 acks.min_ack_hlc(),
300 Some(h100),
301 "watermark must remain at max recorded HLC"
302 );
303}

Callers

nothing calls this directly

Calls 3

repFunction · 0.85
hlcFunction · 0.50
recordMethod · 0.45

Tested by

no test coverage detected