Documentation
¶
Overview ¶
Package tester implements functional-tester tester server.
Index ¶
- type Case
- type Checker
- type Cluster
- 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
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
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) 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