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

Function test_config

nodedb-raft/src/node/rpc/test_helpers.rs:14–27  ·  view source on GitHub ↗

Standard 3-voter (or N-voter) test config with no learners/observers.

(node_id: u64, peers: Vec<u64>)

Source from the content-addressed store, hash-verified

12
13/// Standard 3-voter (or N-voter) test config with no learners/observers.
14pub(super) fn test_config(node_id: u64, peers: Vec<u64>) -> RaftConfig {
15 RaftConfig {
16 node_id,
17 group_id: 1,
18 peers,
19 learners: vec![],
20 observers: vec![],
21 starts_as_learner: false,
22 starts_as_observer: false,
23 election_timeout_min: Duration::from_millis(150),
24 election_timeout_max: Duration::from_millis(300),
25 heartbeat_interval: Duration::from_millis(50),
26 }
27}
28
29/// Config where `node_id` is itself an observer (no peers).
30pub(super) fn observer_self_config(node_id: u64) -> RaftConfig {

Calls

no outgoing calls

Tested by

no test coverage detected