Documentation ¶
Overview ¶
Package tester implements functional-tester tester server.
Index ¶
- Constants
- type Checker
- type Cluster
- func (clus *Cluster) Bootstrap() error
- func (clus *Cluster) DestroyEtcdAgents()
- func (clus *Cluster) FailArchive() error
- func (clus *Cluster) GetLeader() (int, error)
- func (clus *Cluster) Report() int64
- func (clus *Cluster) Restart() error
- func (clus *Cluster) StartTester()
- func (clus *Cluster) WaitHealth() error
- type Failure
- type Stresser
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 ¶
NewCluster creates a client from a tester configuration.
func (*Cluster) Bootstrap ¶
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 ¶
FailArchive sends "FailArchive" operation.
func (*Cluster) WaitHealth ¶
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:
- implement "Failure" interface
- 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.
Source Files ¶
- checks.go
- cluster.go
- cluster_tester.go
- doc.go
- failure.go
- failure_case_delay.go
- failure_case_external.go
- failure_case_failpoints.go
- failure_case_kill.go
- failure_case_network_blackhole.go
- failure_case_network_slow.go
- failure_case_no_op.go
- metrics.go
- stress.go
- stress_composite.go
- stress_key.go
- stress_lease.go
- stress_nop.go
- stress_runner.go
- utils.go
Click to show internal directories.
Click to hide internal directories.