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

Function init_rejects_impossible_budgets

nodedb/src/memory/startup.rs:65–73  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

63
64 #[test]
65 fn init_rejects_impossible_budgets() {
66 // Byte budgets derived against a 1 MiB ceiling sum to ~1 MiB; feeding
67 // them to a governor whose ceiling is only 1000 bytes must fail
68 // `GovernorConfig::validate`.
69 let budgets = EngineConfig::default().to_byte_budgets(1024 * 1024);
70 assert!(budgets.total() > 1000);
71 let result = init_governor(1000, &budgets);
72 assert!(result.is_err());
73 }
74
75 /// Build the governor exactly as the server does on a fresh boot:
76 /// default engine fractions of a 1 GiB ceiling.

Callers

nothing calls this directly

Calls 2

init_governorFunction · 0.85
to_byte_budgetsMethod · 0.80

Tested by

no test coverage detected