package
20.2.19+incompatible
Repository: https://github.com/cockroachdb/cockroach.git
Documentation: pkg.go.dev

# README

Overview

roachtest is a tool for performing large-scale (multi-machine) automated tests. It relies on the concurrently-developed (but separate) tool roachprod.

Setup

  1. Set up roachprod, if you haven't already. This includes making sure $PWD/bin is on your PATH and gcloud is installed and properly configured.
  2. Build a linux release binary of cockroach: build/builder.sh mkrelease amd64-linux-gnu
  3. Build a linux binary of the workload tool: build/builder.sh mkrelease amd64-linux-gnu bin/workload
  4. Build a local binary of roachtest: make bin/roachtest

Usage

You'll usually use roachtest run and specify a single test.

For Cockroach Labs employees, if your local username does not match your gcloud/@cockroachlabs.com username, you'll need to add --user=$CRL_USERNAME to the roachtest command. For non-Cockroach Labs employees, set --gce-project (and maybe --user too).

If $PWD/bin isn't on your PATH, you'll need to add --roachprod=<path-to-roachprod> to the roachtest command.

roachtest run jepsen/1/bank/split

While iterating, don't forget to rebuild whichever of the above binaries you've touched. For example, the command line that you might use while iterating on jepsen tests is make bin/roachtest && roachtest run jepsen/1/bank/split

To keep your cluster after the roachtest finishes, use the --debug flag with roachtest run. You can use roachprod to connect to your cluster and examine the state by using roachprod setup-ssh <cluster name>. This will print out an IP address to connect to using ssh. To have roachtest reuse an existing cluster, pass the --cluster <clustername argument to roachtest run.

# Functions

CtrlC spawns a goroutine that sits around waiting for SIGINT.
FatalIfErr calls t.Fatal() if err != nil.
GetStderr retrieves the stderr output of a command that returned with an error, or the empty string if there was no stderr.
MachineTypeToCPUs returns a CPU count for either a GCE or AWS machine type.
NewDiskUsageLogger populates a DiskUsageLogger.
NewHealthChecker returns a populated HealthChecker.
PredecessorVersion returns a recent predecessor of the build version (i.e.
Toxify takes a cluster and sets it up for use with toxiproxy on the given nodes.

# Constants

The following env variable names match those specified in the TeamCity configuration for the nightly roachtests.
The following env variable names match those specified in the TeamCity configuration for the nightly roachtests.
The following env variable names match those specified in the TeamCity configuration for the nightly roachtests.
The following env variable names match those specified in the TeamCity configuration for the nightly roachtests.
The allowable values of Owner.
The allowable values of Owner.
The allowable values of Owner.
The allowable values of Owner.
The allowable values of Owner.
The allowable values of Owner.
The allowable values of Owner.
The allowable values of Owner.

# Structs

Chaos stops and restarts nodes in a cluster.
DiskUsageLogger regularly logs the disk spaced used by the nodes in the cluster.
HealthChecker runs a regular check that verifies that a specified subset of (CockroachDB) nodes look "very healthy".
OwnerMetadata contains information about a roachtest owning team, such as team slack room, and github project.
Periodic is a chaos timing using fixed durations.
A ToxiCluster wraps a cluster and sets it up for use with toxiproxy.

# Interfaces

ChaosTimer configures a chaos schedule.

# Type aliases

Owner is a valid entry for the Owners field of a roachtest.