storagetest

package
v0.42.3 Latest Latest
Warning

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

Go to latest
Published: Jul 29, 2024 License: GPL-3.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func TestAll

func TestAll(t *testing.T, cons Constructor)

TestAll checks that storage component doesn't panic under any circumstances during shard operation.

func TestCloseAfterOpen

func TestCloseAfterOpen(t *testing.T, cons Constructor)

TestCloseAfterOpen checks that `Close` can be done right after `Open`. Use-case: open shard, encounter error, close before the initialization.

func TestCloseTwice

func TestCloseTwice(t *testing.T, cons Constructor)

TestCloseTwice checks that `Close` can be done twice.

func TestModeTransition

func TestModeTransition(t *testing.T, cons Constructor, from, to mode.Mode)

func TestSetMode

func TestSetMode(t *testing.T, cons Constructor, m mode.Mode)

TestSetMode checks that any mode transition can be done safely.

Types

type Component

type Component interface {
	Open(context.Context, mode.Mode) error
	SetMode(mode.Mode) error
	Init() error
	Close() error
}

Component represents single storage component.

type Constructor

type Constructor = func(t *testing.T) Component

Constructor constructs storage component. Each call must create a component using different file-system path.

Jump to

Keyboard shortcuts

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