Skip to content

Commit

Permalink
Merge #26292
Browse files Browse the repository at this point in the history
26292: roachtest: default --wipe to true for roachtest bench r=nvanbenschoten a=nvanbenschoten

We had made this default to false, but that made it too easy to leak
clusters. Let's not do that.

This change also contains a few usability improvements to tpccbench.

Co-authored-by: Nathan VanBenschoten <[email protected]>
  • Loading branch information
craig[bot] and nvanbenschoten committed May 31, 2018
2 parents f0c9f99 + eb3d44a commit d844b57
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 12 deletions.
11 changes: 2 additions & 9 deletions pkg/cmd/roachtest/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -58,9 +58,6 @@ func main() {
rootCmd.PersistentFlags().BoolVarP(
&encrypt, "encrypt", "", encrypt, "start cluster with encryption at rest turned on")

clusterWipeRun := true
clusterWipeBench := false

var runCmd = &cobra.Command{
Use: "run [tests]",
Short: "run automated tests on cockroach cluster",
Expand All @@ -81,7 +78,6 @@ Use 'roachtest run -n' to see a list of all tests.
r.loadBuildVersion()
}
registerTests(r)
clusterWipe = clusterWipeRun
os.Exit(r.Run(args))
return nil
},
Expand All @@ -107,15 +103,13 @@ Use 'roachtest bench -n' to see a list of all benchmarks.
}
r := newRegistry()
registerBenchmarks(r)
clusterWipe = clusterWipeBench
os.Exit(r.Run(args))
return nil
},
}

// Register flags shared between `run` and `bench`.
wipe := []*bool{&clusterWipeRun, &clusterWipeBench}
for i, cmd := range []*cobra.Command{runCmd, benchCmd} {
for _, cmd := range []*cobra.Command{runCmd, benchCmd} {
cmd.Flags().StringVar(
&artifacts, "artifacts", "artifacts", "path to artifacts directory")
cmd.Flags().StringVar(
Expand All @@ -131,7 +125,7 @@ Use 'roachtest bench -n' to see a list of all benchmarks.
cmd.Flags().StringVar(
&roachprod, "roachprod", "", "path to roachprod binary to use")
cmd.Flags().BoolVar(
wipe[i], "wipe", *wipe[i],
&clusterWipe, "wipe", true,
"wipe existing cluster before starting test (for use with --cluster)")
cmd.Flags().StringVar(
&zonesF, "zones", "", "Zones for the cluster (use roachprod defaults if empty)")
Expand All @@ -147,7 +141,6 @@ Cockroach cluster with existing data.
RunE: func(_ *cobra.Command, args []string) error {
r := newRegistry()
registerStoreGen(r, args)
clusterWipe = true
// We've only registered one store generation "test" that does its own
// argument processing, so no need to provide any arguments to r.Run.
os.Exit(r.Run(nil /* filter */))
Expand Down
6 changes: 3 additions & 3 deletions pkg/cmd/roachtest/tpcc.go
Original file line number Diff line number Diff line change
Expand Up @@ -173,7 +173,7 @@ func loadTPCCBench(
if b.StoreDirVersion != "" {
c.l.printf("ingesting existing tpcc store dump\n")

urlBase, err := c.RunWithBuffer(ctx, c.l, c.Node(1),
urlBase, err := c.RunWithBuffer(ctx, c.l, loadNode,
fmt.Sprintf(`./workload fixtures url tpcc --warehouses=%d`, b.LoadWarehouses))
if err != nil {
return err
Expand Down Expand Up @@ -299,7 +299,7 @@ func runTPCCBench(ctx context.Context, t *test, c *cluster, b tpccBenchSpec) {
out, err := c.RunWithBuffer(ctx, c.l, loadNode, cmd)
loadDone <- timeutil.Now()
if err != nil {
return false, err
return false, errors.Wrapf(err, "error running tpcc load generator:\n\n%s\n", out)
}

// Parse the stats header and stats lines from the output.
Expand Down Expand Up @@ -380,7 +380,7 @@ func registerTPCCBench(r *registry) {
},
// objective 1, key result 1 & 2.
{
Nodes: 18,
Nodes: 30,
CPUs: 16,

LoadWarehouses: 10000,
Expand Down

0 comments on commit d844b57

Please sign in to comment.