Skip to content

Commit

Permalink
roachtest: Hopefully deflake election-after-restart
Browse files Browse the repository at this point in the history
Logs suggest that we're seeing failures when nodes aren't caught up on
all the split processing before the restart, so give this a chance to
finish.

Updates cockroachdb#35047

Release note: None
  • Loading branch information
bdarnell committed Apr 24, 2019
1 parent df024f7 commit f8ce3a4
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions pkg/cmd/roachtest/election.go
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,13 @@ func registerElectionAfterRestart(r *registry) {
duration := timeutil.Since(start)
t.l.Printf("pre-restart, query took %s\n", duration)

// If we restart before all the nodes have applied the splits,
// there will be a lot of snapshot attempts (which may fail)
// after the restart. This appears to slow down startup enough
// to fail the condition below, so wait a bit for the dust to
// settle before restarting.
time.Sleep(3 * time.Second)

t.Status("restarting")
c.Stop(ctx)
c.Start(ctx, t)
Expand Down

0 comments on commit f8ce3a4

Please sign in to comment.