Struct openraft::testing::Suite

source ·
pub struct Suite<C, LS, SM, B, G>
where C: RaftTypeConfig, C::D: Debug, C::R: Debug, LS: RaftLogStorage<C>, SM: RaftStateMachine<C>, B: StoreBuilder<C, LS, SM, G>, G: Send + Sync,
{ /* private fields */ }
Expand description

Test suite to ensure a RaftStore impl works as expected.

Additional traits are required to be implemented by the store builder for testing:

  • C::D and C::R requires Debug for debugging.
  • C::NodeId requires From<u64> to build a node id.

Implementations§

source§

impl<C, LS, SM, B, G> Suite<C, LS, SM, B, G>
where C: RaftTypeConfig, C::D: Debug, C::R: Debug, C::NodeId: From<u64>, LS: RaftLogStorage<C>, SM: RaftStateMachine<C>, B: StoreBuilder<C, LS, SM, G>, G: Send + Sync,

source

pub fn test_all(builder: B) -> Result<(), StorageError<C::NodeId>>

source

pub fn test_store(builder: &B) -> Result<(), StorageError<C::NodeId>>

source

pub async fn last_membership_in_log_initial( store: LS, sm: SM ) -> Result<(), StorageError<C::NodeId>>

source

pub async fn last_membership_in_log( store: LS, sm: SM ) -> Result<(), StorageError<C::NodeId>>

source

pub async fn last_membership_in_log_multi_step( store: LS, sm: SM ) -> Result<(), StorageError<C::NodeId>>

source

pub async fn get_membership_initial( store: LS, sm: SM ) -> Result<(), StorageError<C::NodeId>>

source

pub async fn get_membership_from_log_and_empty_sm( store: LS, sm: SM ) -> Result<(), StorageError<C::NodeId>>

source

pub async fn get_membership_from_empty_log_and_sm( store: LS, sm: SM ) -> Result<(), StorageError<C::NodeId>>

source

pub async fn get_membership_from_log_le_sm_last_applied( store: LS, sm: SM ) -> Result<(), StorageError<C::NodeId>>

source

pub async fn get_membership_from_log_gt_sm_last_applied_1( store: LS, sm: SM ) -> Result<(), StorageError<C::NodeId>>

source

pub async fn get_membership_from_log_gt_sm_last_applied_2( store: LS, sm: SM ) -> Result<(), StorageError<C::NodeId>>

source

pub async fn get_initial_state_without_init( store: LS, sm: SM ) -> Result<(), StorageError<C::NodeId>>

source

pub async fn get_initial_state_with_state( store: LS, sm: SM ) -> Result<(), StorageError<C::NodeId>>

source

pub async fn get_initial_state_membership_from_log_and_sm( store: LS, sm: SM ) -> Result<(), StorageError<C::NodeId>>

source

pub async fn get_initial_state_last_log_gt_sm( store: LS, sm: SM ) -> Result<(), StorageError<C::NodeId>>

source

pub async fn get_initial_state_last_log_lt_sm( store: LS, sm: SM ) -> Result<(), StorageError<C::NodeId>>

source

pub async fn get_initial_state_log_ids( store: LS, sm: SM ) -> Result<(), StorageError<C::NodeId>>

source

pub async fn get_initial_state_re_apply_committed( store: LS, sm: SM ) -> Result<(), StorageError<C::NodeId>>

Test if committed logs are re-applied.

source

pub async fn save_vote(store: LS, sm: SM) -> Result<(), StorageError<C::NodeId>>

source

pub async fn get_log_entries( store: LS, sm: SM ) -> Result<(), StorageError<C::NodeId>>

source

pub async fn try_get_log_entry( store: LS, sm: SM ) -> Result<(), StorageError<C::NodeId>>

source

pub async fn initial_logs( store: LS, sm: SM ) -> Result<(), StorageError<C::NodeId>>

source

pub async fn get_log_state( store: LS, sm: SM ) -> Result<(), StorageError<C::NodeId>>

source

pub async fn get_log_id( store: LS, sm: SM ) -> Result<(), StorageError<C::NodeId>>

source

pub async fn last_id_in_log( store: LS, sm: SM ) -> Result<(), StorageError<C::NodeId>>

source

pub async fn last_applied_state( store: LS, sm: SM ) -> Result<(), StorageError<C::NodeId>>

source

pub async fn purge_logs_upto_0( store: LS, sm: SM ) -> Result<(), StorageError<C::NodeId>>

source

pub async fn purge_logs_upto_5( store: LS, sm: SM ) -> Result<(), StorageError<C::NodeId>>

source

pub async fn purge_logs_upto_20( store: LS, sm: SM ) -> Result<(), StorageError<C::NodeId>>

source

pub async fn delete_logs_since_11( store: LS, sm: SM ) -> Result<(), StorageError<C::NodeId>>

source

pub async fn delete_logs_since_0( store: LS, sm: SM ) -> Result<(), StorageError<C::NodeId>>

source

pub async fn append_to_log( store: LS, sm: SM ) -> Result<(), StorageError<C::NodeId>>

source

pub async fn snapshot_meta( store: LS, sm: SM ) -> Result<(), StorageError<C::NodeId>>

source

pub async fn apply_single( store: LS, sm: SM ) -> Result<(), StorageError<C::NodeId>>

source

pub async fn apply_multiple( store: LS, sm: SM ) -> Result<(), StorageError<C::NodeId>>

source

pub async fn feed_10_logs_vote_self( sto: &mut LS ) -> Result<(), StorageError<C::NodeId>>

source

pub async fn default_vote(sto: &mut LS) -> Result<(), StorageError<C::NodeId>>

Auto Trait Implementations§

§

impl<C, LS, SM, B, G> Freeze for Suite<C, LS, SM, B, G>

§

impl<C, LS, SM, B, G> RefUnwindSafe for Suite<C, LS, SM, B, G>

§

impl<C, LS, SM, B, G> Send for Suite<C, LS, SM, B, G>

§

impl<C, LS, SM, B, G> Sync for Suite<C, LS, SM, B, G>

§

impl<C, LS, SM, B, G> Unpin for Suite<C, LS, SM, B, G>
where C: Unpin, LS: Unpin, SM: Unpin, B: Unpin, G: Unpin,

§

impl<C, LS, SM, B, G> UnwindSafe for Suite<C, LS, SM, B, G>

Blanket Implementations§

source§

impl<T> Any for T
where T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T> Instrument for T

source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
source§

impl<T> Instrument for T

source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
source§

impl<T, U> Into<U> for T
where U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

source§

fn vzip(self) -> V

source§

impl<T> WithSubscriber for T

source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more
source§

impl<T> WithSubscriber for T

source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more
source§

impl<T> OptionalSend for T
where T: Send + ?Sized,

source§

impl<T> OptionalSync for T
where T: Sync + ?Sized,