Skip to content

Commit

Permalink
roachtest: Another attempt at deflaking election-after-restart
Browse files Browse the repository at this point in the history
The sleep added in the previous PR didn't eliminate the flakiness,
because it appears that the initial ranges weren't fully replicated.
Add another sleep before the splits in another attempt to get
everything into a stable configuration before restart.

Updates cockroachdb#35047

Release note: None
  • Loading branch information
bdarnell authored and ajwerner committed May 15, 2019
1 parent b355cc1 commit cbdcce0
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions pkg/cmd/roachtest/election.go
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,12 @@ func registerElectionAfterRestart(r *registry) {
c.Put(ctx, cockroach, "./cockroach")
c.Start(ctx, t)

// If the initial ranges aren't fully replicated by the time we
// run our splits, replicating them after the splits will take
// longer, so wait for the initial replication before
// proceeding.
time.Sleep(3 * time.Second)

t.Status("creating table and splits")
c.Run(ctx, c.Node(1), `./cockroach sql --insecure -e "
CREATE DATABASE IF NOT EXISTS test;
Expand Down

0 comments on commit cbdcce0

Please sign in to comment.