ee

package
v0.20.0 Latest Latest
Warning

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

Go to latest
Published: Mar 5, 2024 License: Apache-2.0 Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AnyBackupSNFail

func AnyBackupSNFail(tc cluster.Cluster, snid *types.StorageNodeID, nodeName *string) func(context.Context, *testing.T) bool

func FailStorageNode

func FailStorageNode(ctx context.Context, t *testing.T, tc cluster.Cluster, snid types.StorageNodeID) func()

func InitLogStream

func InitLogStream(ctx context.Context, tc cluster.Cluster, num int) func(*testing.T, *Action)

func NewCluster added in v0.7.0

func NewCluster(t *testing.T, opts ...cluster.Option) cluster.Cluster

func StartStorageNode

func StartStorageNode(tc cluster.Cluster, nodeNameGetter func() string) func(context.Context, *testing.T) bool

func WaitStorageNodeFail

func WaitStorageNodeFail(c cluster.Cluster, nodeNameGetter func() string) func(context.Context, *testing.T) bool

Types

type Action

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

Action tests basic APIs of the Varlog, which are Append, AppendTo, Subscribe, and SubscribeTo while doing reconfigurations of the cluster.

func NewAction

func NewAction(t *testing.T, opts ...ActionOption) *Action

NewAction creates a new Action. Users should define all reconfigurations to cluster by using ConfChanger.

func (*Action) AddLogStream

func (action *Action) AddLogStream(tpid types.TopicID, lsid types.LogStreamID)

AddLogStream adds a new log stream to the Action while running. It allows knowing log streams added in runtime.

func (*Action) AddTopic

func (action *Action) AddTopic(tpid types.TopicID)

AddTopic adds a new topic to the Action while running. It allows knowing topics added in runtime.

func (*Action) Do

func (action *Action) Do(ctx context.Context, t *testing.T)

Do runs the action.

type ActionOption

type ActionOption interface {
	// contains filtered or unexported methods
}

func WithClusterID

func WithClusterID(cid types.ClusterID) ActionOption

func WithConfChange

func WithConfChange(confChanger ConfChanger) ActionOption

func WithMRAddr

func WithMRAddr(mrAddr string) ActionOption

func WithNumClient

func WithNumClient(nrCli int) ActionOption

func WithNumRepeats

func WithNumRepeats(numRepeats int) ActionOption

func WithNumSubscriber

func WithNumSubscriber(nrSub int) ActionOption

func WithPostHook

func WithPostHook(postHook func(*testing.T, *Action)) ActionOption

func WithPreHook

func WithPreHook(preHook func(*testing.T, *Action)) ActionOption

func WithTitle

func WithTitle(title string) ActionOption

type ConfChanger

type ConfChanger interface {
	Do(context.Context, *testing.T) bool
	Name() string
}

func NewConfChanger

func NewConfChanger(opts ...ConfChangerOption) ConfChanger

type ConfChangerOption

type ConfChangerOption interface {
	// contains filtered or unexported methods
}

func WithChangeFunc

func WithChangeFunc(changeFunc func(context.Context, *testing.T) bool) ConfChangerOption

func WithCheckFunc

func WithCheckFunc(checkFunc func(context.Context, *testing.T) bool) ConfChangerOption

func WithConfChangeInterval

func WithConfChangeInterval(dur time.Duration) ConfChangerOption

func WithName

func WithName(name string) ConfChangerOption

type LoggerOption

type LoggerOption interface {
	ActionOption
	ConfChangerOption
}

func WithLogger

func WithLogger(logger *zap.Logger) LoggerOption

Jump to

Keyboard shortcuts

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