From f8ce3a49471a8b04deaddf6259fa543cf494d0f9 Mon Sep 17 00:00:00 2001 From: Ben Darnell Date: Wed, 24 Apr 2019 17:35:07 -0400 Subject: [PATCH] roachtest: Hopefully deflake election-after-restart 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 #35047 Release note: None --- pkg/cmd/roachtest/election.go | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/pkg/cmd/roachtest/election.go b/pkg/cmd/roachtest/election.go index 7e574ce3e482..0f8f02e2ade0 100644 --- a/pkg/cmd/roachtest/election.go +++ b/pkg/cmd/roachtest/election.go @@ -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)