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

Function stream_buffer_retention_evicts_oldest

nodedb/tests/event_cdc.rs:34–49  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

32
33#[test]
34fn stream_buffer_retention_evicts_oldest() {
35 let retention = RetentionConfig {
36 max_events: 3,
37 max_age_secs: 86_400,
38 };
39 let buf = StreamBuffer::new("orders_stream".to_string(), retention);
40
41 for i in 1..=5 {
42 buf.push(make_cdc_event(i, 0, "orders", "INSERT"));
43 }
44
45 let events = buf.read_from_lsn(0, 100);
46 assert_eq!(events.len(), 3);
47 // Oldest (seq 1, 2) evicted; remaining are 3, 4, 5.
48 assert_eq!(events[0].sequence, 3);
49}
50
51#[test]
52fn consumer_group_offset_tracking() {

Callers

nothing calls this directly

Calls 4

make_cdc_eventFunction · 0.85
to_stringMethod · 0.80
read_from_lsnMethod · 0.80
pushMethod · 0.45

Tested by

no test coverage detected