Open-Source Wikis

/

CockroachDB

/

Applications

/

roachtest

cockroachdb/cockroach

roachtest

roachtest is CockroachDB's framework for long-running, distributed-system tests. Each test boots a real cluster (via roachprod) and runs an end-to-end scenario — TPC-C imports, schema-change-under-load, decommissioning, network partitions, version upgrades, kafka changefeed pipelines.

Source

  • pkg/cmd/roachtest/ — CLI and runtime.
  • pkg/cmd/roachtest/tests/ — every individual test definition.
  • pkg/cmd/roachtest/registry/ — how tests are registered.
  • pkg/cmd/roachtest/operations/ — long-running operations (e.g. add-node, drain, kill).
  • pkg/cmd/roachtest/option/ — typed test options.
  • pkg/cmd/roachtest/spec/ — cluster and test-spec types.

A test in shape

r.Add(registry.TestSpec{
    Name:    "tpcc/nodes=3",
    Owner:   registry.OwnerKV,
    Cluster: r.MakeClusterSpec(3),
    Run: func(ctx context.Context, t test.Test, c cluster.Cluster) {
        c.Put(ctx, t.Cockroach(), "./cockroach")
        c.Start(ctx, t.L(), option.DefaultStartOpts(), install.MakeClusterSettings())
        c.Run(ctx, ...) // workload init + run
    },
})

Where they run

  • Local--local runs against a local Docker cluster.
  • Cloud--cloud=gce|aws|azure provisions VMs through roachprod.

CI runs the full nightly suite against AWS and GCE; the suite is sharded so it finishes in a few hours.

Built by Factory AutoWiki from public repository content. It is a generated preview for codebase exploration, not source-maintained documentation.

roachtest – CockroachDB wiki | Factory