metadatadbtest

package
v0.3.1 Latest Latest
Warning

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

Go to latest
Published: Jul 20, 2026 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func SkipUnlessSoak added in v0.3.0

func SkipUnlessSoak(t *testing.T)

SkipUnlessSoak skips the test unless SOAK_TEST is set. Call it before any expensive setup; Soak and SoakReplicas also enforce it.

func Suite

func Suite(t *testing.T, newBackends func(t *testing.T, n int) []metadatadb.Backend)

Suite runs a comprehensive test suite against a metadatadb.Backend implementation. The factory must return n backends that share the same underlying storage.

Types

type SoakConfig

type SoakConfig struct {
	Duration    time.Duration
	Concurrency int
	NumKeys     int
}

SoakConfig configures the soak test parameters.

type SoakResult

type SoakResult struct {
	Ops      int64
	Flushes  int64
	Errors   int64
	Duration time.Duration
}

SoakResult contains the results of a soak test run.

func Soak

func Soak(t *testing.T, backend metadatadb.Backend, config SoakConfig) SoakResult

Soak runs a concurrent soak test against a backend, exercising all data structure types with random operations and periodic flushes, then verifies consistency by checking monotonic invariants and round-trip equality.

func SoakReplicas added in v0.3.0

func SoakReplicas(t *testing.T, backends []metadatadb.Backend, config SoakConfig) SoakResult

SoakReplicas runs the soak workload concurrently across multiple backends sharing the same underlying storage, then verifies the monotonic invariants on every replica and that all replicas converge to identical state.

Jump to

Keyboard shortcuts

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