Skip to content

Commit

Permalink
roachtest: return error in StopCockroachGracefullyOnNode
Browse files Browse the repository at this point in the history
That function misleadingly returned an (always nil) error, calling
`t.Fatal()` functions in it. The calls to `Stop` have been replaced
with calls to `StopE`.

Epic: none

Release note: None
  • Loading branch information
renatolabs committed Feb 6, 2023
1 parent c9dde80 commit d378625
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions pkg/cmd/roachtest/cluster.go
Original file line number Diff line number Diff line change
Expand Up @@ -1047,14 +1047,14 @@ func (c *clusterImpl) StopCockroachGracefullyOnNode(
gracefulOpts.RoachprodOpts.Sig = 15 // SIGTERM
gracefulOpts.RoachprodOpts.Wait = true
gracefulOpts.RoachprodOpts.MaxWait = 60
c.Stop(ctx, l, gracefulOpts, c.Node(node))
// NB: we still call Stop to make sure the process is dead when we try
// to restart it (or we'll catch an error from the RocksDB dir being
// locked). This won't happen unless run with --local due to timing.
c.Stop(ctx, l, option.DefaultStopOpts(), c.Node(node))
// TODO(tschottdorf): should return an error. I doubt that we want to
// call these *testing.T-style methods on goroutines.
return nil
if err := c.StopE(ctx, l, gracefulOpts, c.Node(node)); err != nil {
return err
}

// NB: we still call Stop to make sure the process is dead when we
// try to restart it (in case it takes longer than `MaxWait` for it
// to finish).
return c.StopE(ctx, l, option.DefaultStopOpts(), c.Node(node))
}

// Save marks the cluster as "saved" so that it doesn't get destroyed.
Expand Down

0 comments on commit d378625

Please sign in to comment.