raftenginetest

package
v0.0.0-...-c9a7870 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 20, 2026 License: AGPL-3.0 Imports: 9 Imported by: 0

Documentation

Overview

Package raftenginetest provides a shared conformance test suite for raftengine.Engine implementations. Each engine package should call RunConformanceSuite with its own Factory in a _test.go file.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func RunConformanceSuite

func RunConformanceSuite(t *testing.T, factory raftengine.Factory)

RunConformanceSuite runs the shared conformance tests against the given factory. The factory should create single-node, self-bootstrapping engines.

Types

type TestStateMachine

type TestStateMachine struct {
	// contains filtered or unexported fields
}

TestStateMachine is a simple in-memory state machine for testing. It records all applied entries and supports snapshot/restore via a binary encoding.

func (*TestStateMachine) Applied

func (s *TestStateMachine) Applied() [][]byte

func (*TestStateMachine) Apply

func (s *TestStateMachine) Apply(data []byte) any

func (*TestStateMachine) Restore

func (s *TestStateMachine) Restore(r io.Reader) error

func (*TestStateMachine) Snapshot

func (s *TestStateMachine) Snapshot() (raftengine.Snapshot, error)

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL