pub async fn assert_pristine_cluster(&self) {
        let nodes = self.latest_metrics().await;
        for node in nodes.iter() {
            assert!(
                node.current_leader.is_none(),
                "node {} has a current leader, expected none",
                node.id
            );
            assert_eq!(
                node.state,
                State::NonVoter,
                "node is in state {:?}, expected NonVoter",
                node.state
            );
            assert_eq!(
                node.current_term, 0,
                "node {} has term {}, expected 0",
                node.id, node.current_term
            );
            assert_eq!(
                node.last_applied, 0,
                "node {} has last_applied {}, expected 0",
                node.id, node.last_applied
            );
            assert_eq!(
                node.last_log_index, 0,
                "node {} has last_log_index {}, expected 0",
                node.id, node.last_log_index
            );
            let members = node.membership_config.members.iter().collect::<Vec<_>>();
            assert_eq!(
                members,
                vec![&node.id],
                "node {0} has membership {1:?}, expected [{0}]",
                node.id,
                members
            );
            assert!(
                node.membership_config.members_after_consensus.is_none(),
                "node {} is in joint consensus, expected uniform consensus",
                node.id
            );
        }
    }
/// Assert that the cluster is in a pristine state, with all nodes as non-voters.
Assert that the cluster is in a pristine state, with all nodes as non-voters.
Assert that the cluster is in a pristine state with all nodes as non - voters .
pub async fn assert_pristine_cluster(&self) {
        let nodes = self.latest_metrics().await;
        for node in nodes.iter() {
            assert!(
                node.current_leader.is_none(),
                "node {} has a current leader, expected none",
                node.id
            );
            assert_eq!(
                node.state,
                State::NonVoter,
                "node is in state {:?}, expected NonVoter",
                node.state
            );
            assert_eq!(
                node.current_term, 0,
                "node {} has term {}, expected 0",
                node.id, node.current_term
            );
            assert_eq!(
                node.last_applied, 0,
                "node {} has last_applied {}, expected 0",
                node.id, node.last_applied
            );
            assert_eq!(
                node.last_log_index, 0,
                "node {} has last_log_index {}, expected 0",
                node.id, node.last_log_index
            );
            let members = node.membership_config.members.iter().collect::<Vec<_>>();
            assert_eq!(
                members,
                vec![&node.id],
                "node {0} has membership {1:?}, expected [{0}]",
                node.id,
                members
            );
            assert!(
                node.membership_config.members_after_consensus.is_none(),
                "node {} is in joint consensus, expected uniform consensus",
                node.id
            );
        }
    }
pub async fn assert_pristine_cluster ( & self ) { let nodes = self . latest_metrics ( ) . await ; for node in nodes . iter ( ) { assert ! ( node current_leader is_none ( ) " " node id ) ; assert_eq ! ( node state State NonVoter " " node state ) ; assert_eq ! ( node current_term 0 " " node id node current_term ) ; assert_eq ! ( node last_applied 0 " " node id node last_applied ) ; assert_eq ! ( node last_log_index 0 " " node id node last_log_index ) ; let members = node . membership_config . members . iter ( ) . collect :: < Vec < _ > > ( ) ; assert_eq ! ( members vec [ node id ] " " node id members ) ; assert ! ( node membership_config members_after_consensus is_none ( ) " " node id ) ; } }
Assert that the cluster is in a pristine state, with all nodes as non-voters.
Assert that the cluster is in a pristine state with all nodes as non - voters .
&self
&self