tester

package
v3.3.0-rc.0.0...-d8dc29e Latest Latest
Warning

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

Go to latest
Published: Apr 3, 2018 License: Apache-2.0 Imports: 28 Imported by: 0

Documentation

Overview

Package tester implements functional-tester tester server.

Index

Constants

View Source
const (
	// time to live for lease
	TTL      = 120
	TTLShort = 2
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Checker

type Checker interface {
	// Check returns an error if the system fails a consistency check.
	Check() error
}

Checker checks cluster consistency.

type Cluster

type Cluster struct {
	Members []*rpcpb.Member `yaml:"agent-configs"`
	Tester  *rpcpb.Tester   `yaml:"tester-config"`
	// contains filtered or unexported fields
}

Cluster defines tester cluster.

func NewCluster

func NewCluster(lg *zap.Logger, fpath string) (*Cluster, error)

NewCluster creates a client from a tester configuration.

func (*Cluster) Bootstrap

func (clus *Cluster) Bootstrap() error

Bootstrap bootstraps etcd cluster the very first time. After this, just continue to call kill/restart.

func (*Cluster) DestroyEtcdAgents

func (clus *Cluster) DestroyEtcdAgents()

DestroyEtcdAgents terminates all tester connections to agents and etcd servers.

func (*Cluster) FailArchive

func (clus *Cluster) FailArchive() error

FailArchive sends "FailArchive" operation.

func (*Cluster) GetLeader

func (clus *Cluster) GetLeader() (int, error)

GetLeader returns the index of leader and error if any.

func (*Cluster) Report

func (clus *Cluster) Report() int64

func (*Cluster) Restart

func (clus *Cluster) Restart() error

Restart sends "Restart" operation.

func (*Cluster) StartTester

func (clus *Cluster) StartTester()

StartTester starts tester.

func (*Cluster) WaitHealth

func (clus *Cluster) WaitHealth() error

WaitHealth ensures all members are healthy by writing a test key to etcd cluster.

type Failure

type Failure interface {
	// Inject injeccts the failure into the testing cluster at the given
	// round. When calling the function, the cluster should be in health.
	Inject(clus *Cluster) error
	// Recover recovers the injected failure caused by the injection of the
	// given round and wait for the recovery of the testing cluster.
	Recover(clus *Cluster) error
	// Desc returns a description of the failure
	Desc() string
}

Failure defines failure injection interface. To add a fail case:

  1. implement "Failure" interface
  2. define fail case name in "rpcpb.FailureCase"

type Stresser

type Stresser interface {
	// Stress starts to stress the etcd cluster
	Stress() error
	// Pause stops the stresser from sending requests to etcd. Resume by calling Stress.
	Pause()
	// Close releases all of the Stresser's resources.
	Close()
	// ModifiedKeys reports the number of keys created and deleted by stresser
	ModifiedKeys() int64
	// Checker returns an invariant checker for after the stresser is canceled.
	Checker() Checker
}

Stresser defines stressing client operations.

Jump to

Keyboard shortcuts

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