package tester
import "github.com/coreos/etcd/functional/tester"
Package tester implements functional-tester tester server.
Index ¶
- type Case
- type Checker
- type Cluster
- func NewCluster(lg *zap.Logger, fpath string) (*Cluster, error)
- func (clus *Cluster) EtcdClientEndpoints() (css []string)
- func (clus *Cluster) GetCaseDelayDuration() time.Duration
- func (clus *Cluster) GetLeader() (int, error)
- func (clus *Cluster) Report() int64
- func (clus *Cluster) Run()
- func (clus *Cluster) Send_INITIAL_START_ETCD() error
- func (clus *Cluster) Send_SIGQUIT_ETCD_AND_REMOVE_DATA_AND_STOP_AGENT()
- func (clus *Cluster) UpdateDelayLatencyMs()
- func (clus *Cluster) WaitHealth() error
- type Stresser
Types ¶
type Case ¶
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:
- implement "Case" interface
- define fail case name in "rpcpb.Case"
type Checker ¶
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 ¶
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 ¶
NewCluster creates a client from a tester configuration.
func (*Cluster) EtcdClientEndpoints ¶
EtcdClientEndpoints returns all etcd client endpoints.
func (*Cluster) GetCaseDelayDuration ¶
GetCaseDelayDuration computes failure delay duration.
func (*Cluster) GetLeader ¶
GetLeader returns the index of leader and error if any.
func (*Cluster) Report ¶
Report reports the number of modified keys.
func (*Cluster) Run ¶
func (clus *Cluster) Run()
Run starts tester.
func (*Cluster) Send_INITIAL_START_ETCD ¶
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 ¶
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 ¶
func (clus *Cluster) UpdateDelayLatencyMs()
UpdateDelayLatencyMs updates delay latency with random value within election timeout.
func (*Cluster) WaitHealth ¶
WaitHealth ensures all members are healthy by writing a test key to etcd cluster.
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() 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.
Source 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
- Version
- v3.3.4+incompatible
- Published
- Apr 24, 2018
- Platform
- linux/amd64
- Imports
- 32 packages
- Last checked
- 11 minutes ago –
Tools for package owners.