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

Function force_flush_over_threshold

nodedb/src/storage/checkpoint.rs:246–259  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

244
245 #[test]
246 fn force_flush_over_threshold() {
247 let config = CheckpointConfig {
248 force_flush_threshold: 50,
249 tick_interval: Duration::from_millis(0),
250 ..Default::default()
251 };
252 let mut coord = CheckpointCoordinator::new(config);
253 coord.register_engine("sparse");
254 coord.mark_dirty("sparse", 100); // Over threshold.
255
256 let plan = coord.tick();
257 let sparse_flush = plan.iter().find(|(e, _)| e == "sparse").unwrap().1;
258 assert_eq!(sparse_flush, 100); // Force full flush.
259 }
260
261 #[test]
262 fn clean_after_all_flushed() {

Callers

nothing calls this directly

Calls 5

register_engineMethod · 0.80
mark_dirtyMethod · 0.80
tickMethod · 0.45
findMethod · 0.45
iterMethod · 0.45

Tested by

no test coverage detected