From cbdcce07a44fda13af8dfa7072e91c69d813d4ec Mon Sep 17 00:00:00 2001 From: Ben Darnell Date: Tue, 30 Apr 2019 14:09:46 -0400 Subject: [PATCH] roachtest: Another attempt at deflaking election-after-restart 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 #35047 Release note: None --- pkg/cmd/roachtest/election.go | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/pkg/cmd/roachtest/election.go b/pkg/cmd/roachtest/election.go index 0f8f02e2ade0..2b4d5ecee089 100644 --- a/pkg/cmd/roachtest/election.go +++ b/pkg/cmd/roachtest/election.go @@ -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;