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

Function worst_engine_pressure_picks_highest

nodedb-mem/src/governor.rs:772–783  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

770
771 #[test]
772 fn worst_engine_pressure_picks_highest() {
773 let gov = MemoryGovernor::new(test_config()).unwrap();
774 assert_eq!(gov.worst_engine_pressure(), PressureLevel::Normal);
775
776 // Push Query to Critical (2048 limit; 1800 ≈ 87%) while Vector/Timeseries
777 // stay Normal — the worst-case must follow Query.
778 let _tok = gov
779 .try_reserve(db(), tenant(), EngineId::Query, 1800)
780 .unwrap();
781 assert_eq!(gov.engine_pressure(EngineId::Vector), PressureLevel::Normal);
782 assert_eq!(gov.worst_engine_pressure(), PressureLevel::Critical);
783 }
784
785 #[test]
786 fn invalid_config_rejected() {

Callers

nothing calls this directly

Calls 4

test_configFunction · 0.70
dbFunction · 0.70
tenantFunction · 0.70
try_reserveMethod · 0.45

Tested by

no test coverage detected