etcd: github.com/coreos/etcd/functional/tester Index | Files

package tester

import "github.com/coreos/etcd/functional/tester"

Package tester implements functional-tester tester server.

Index

Package Files

case.go case_delay.go case_external.go case_failpoints.go case_network_blackhole.go case_network_delay.go case_no_fail.go case_sigquit_remove.go case_sigquit_remove_quorum.go case_sigterm.go checker.go checker_kv_hash.go checker_lease_expire.go checker_no_check.go checker_runner.go cluster.go cluster_read_config.go cluster_run.go cluster_shuffle.go doc.go metrics_report.go stresser.go stresser_composite.go stresser_key.go stresser_lease.go stresser_runner.go utils.go

type Case Uses

type Case 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
    // TestCase returns "rpcpb.Case" enum type.
    TestCase() rpcpb.Case
}

Case defines failure/test injection interface. To add a test case:

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

type Checker Uses

type Checker interface {
    // Type returns the checker type.
    Type() rpcpb.Checker
    // EtcdClientEndpoints returns the client endpoints of
    // all checker target nodes..
    EtcdClientEndpoints() []string
    // Check returns an error if the system fails a consistency check.
    Check() error
}

Checker checks cluster consistency.

type Cluster Uses

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 Uses

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

NewCluster creates a client from a tester configuration.

func (*Cluster) EtcdClientEndpoints Uses

func (clus *Cluster) EtcdClientEndpoints() (css []string)

EtcdClientEndpoints returns all etcd client endpoints.

func (*Cluster) GetCaseDelayDuration Uses

func (clus *Cluster) GetCaseDelayDuration() time.Duration

GetCaseDelayDuration computes failure delay duration.

func (*Cluster) GetLeader Uses

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

GetLeader returns the index of leader and error if any.

func (*Cluster) Report Uses

func (clus *Cluster) Report() int64

Report reports the number of modified keys.

func (*Cluster) Run Uses

func (clus *Cluster) Run()

Run starts tester.

func (*Cluster) Send_INITIAL_START_ETCD Uses

func (clus *Cluster) Send_INITIAL_START_ETCD() error

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

func (*Cluster) Send_SIGQUIT_ETCD_AND_REMOVE_DATA_AND_STOP_AGENT Uses

func (clus *Cluster) Send_SIGQUIT_ETCD_AND_REMOVE_DATA_AND_STOP_AGENT()

Send_SIGQUIT_ETCD_AND_REMOVE_DATA_AND_STOP_AGENT terminates all tester connections to agents and etcd servers.

func (*Cluster) UpdateDelayLatencyMs Uses

func (clus *Cluster) UpdateDelayLatencyMs()

UpdateDelayLatencyMs updates delay latency with random value within election timeout.

func (*Cluster) WaitHealth Uses

func (clus *Cluster) WaitHealth() error

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

type Stresser Uses

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() map[string]int
    // Close releases all of the Stresser's resources.
    Close() map[string]int
    // ModifiedKeys reports the number of keys created and deleted by stresser
    ModifiedKeys() int64
}

Stresser defines stressing client operations.

Package tester imports 35 packages (graph). Updated 2019-10-02. Refresh now. Tools for package owners.