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

Function snapshot_without_groups

nodedb-cluster/src/cluster_info.rs:295–312  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

293
294 #[test]
295 fn snapshot_without_groups() {
296 // A node whose RaftLoop reports zero groups (not in cluster
297 // mode, but we got a stub observer). Topology still rendered.
298 let lifecycle = ClusterLifecycleTracker::new();
299 lifecycle.to_bootstrapping();
300 let peers = vec![NodeInfo::new(
301 1,
302 "127.0.0.1:9400".parse().unwrap(),
303 NodeState::Active,
304 )];
305 let routing = RoutingTable::uniform(1, &[1], 1);
306 let observer = make_observer(lifecycle, peers, routing, vec![]);
307
308 let snap = observer.snapshot();
309 assert_eq!(snap.lifecycle_label(), "bootstrapping");
310 assert_eq!(snap.members_count(), 1);
311 assert_eq!(snap.groups_count(), 0);
312 }
313
314 #[test]
315 fn snapshot_is_json_roundtrippable() {

Callers

nothing calls this directly

Calls 3

make_observerFunction · 0.85
to_bootstrappingMethod · 0.80
snapshotMethod · 0.45

Tested by

no test coverage detected