Skip to content

Commit

Permalink
roachtest/bank: don't start chaos until nodes are serving SQL
Browse files Browse the repository at this point in the history
Informs cockroachdb#30064.

This prevents us from running into issues with SQL migrations.

Release note: None
  • Loading branch information
nvanbenschoten committed Oct 15, 2018
1 parent 30c3d5b commit b1ab7dd
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions pkg/cmd/roachtest/bank.go
Original file line number Diff line number Diff line change
Expand Up @@ -211,6 +211,21 @@ func (s *bankState) startChaosMonkey(
go func() {
defer s.waitGroup.Done()

// Don't begin the chaos monkey until all nodes are serving SQL connections.
// This ensures that we don't test cluster initialization under chaos.
for i := 1; i <= c.nodes; i++ {
db := c.Conn(ctx, i)
var res int
err := db.QueryRowContext(ctx, `SELECT 1`).Scan(&res)
if err != nil {
t.Fatal(err)
}
err = db.Close()
if err != nil {
t.Fatal(err)
}
}

for curRound := uint64(1); !s.done(ctx); curRound++ {
atomic.StoreUint64(&s.monkeyIteration, curRound)

Expand Down

0 comments on commit b1ab7dd

Please sign in to comment.