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

Function learner_promotion_checks_lag

nodedb-cluster/src/lifecycle.rs:188–200  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

186
187 #[test]
188 fn learner_promotion_checks_lag() {
189 let mut topo = ClusterTopology::new();
190 let addr: SocketAddr = "127.0.0.1:9000".parse().unwrap();
191 let info = NodeInfo::new(10, addr, NodeState::Joining);
192 topo.join_as_learner(info);
193
194 let result = handle_learner_promotion(10, &mut topo, 100, 10);
195 assert!(result.is_err());
196
197 let result = handle_learner_promotion(10, &mut topo, 5, 10);
198 assert!(result.is_ok());
199 assert_eq!(topo.get_node(10).unwrap().state, NodeState::Active);
200 }
201
202 #[test]
203 fn decommission_already_decommissioned_fails() {

Callers

nothing calls this directly

Calls 3

handle_learner_promotionFunction · 0.85
join_as_learnerMethod · 0.80
parseMethod · 0.45

Tested by

no test coverage detected