From 20776edbec365934c575b75885a3b7e377e96070 Mon Sep 17 00:00:00 2001 From: Tobias Schottdorf Date: Tue, 23 Oct 2018 10:38:02 +0200 Subject: [PATCH] roachtest: use high connect timeout in election test It's possible the default of 5s is simply too tight, but as an easy indication for that we can see what total duration the test takes assuming it gets plenty of time to connect. Closes #31615. Release note: None --- pkg/cmd/roachtest/election.go | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/pkg/cmd/roachtest/election.go b/pkg/cmd/roachtest/election.go index 15609cf3037a..6d51716100f9 100644 --- a/pkg/cmd/roachtest/election.go +++ b/pkg/cmd/roachtest/election.go @@ -57,7 +57,11 @@ func registerElectionAfterRestart(r *registry) { // this up are working (we trigger elections eagerly, but not so // eagerly that multiple elections conflict with each other). start = timeutil.Now() - buf, err := c.RunWithBuffer(ctx, t.l, c.Node(1), `./cockroach sql --insecure -e " + // Use a large CONNECT_TIMEOUT so that if the initial connection + // takes ages (perhaps due to some cli-internal query taking a + // very long time), we fail with the duration check below and + // not an opaque error from the cli. + buf, err := c.RunWithBuffer(ctx, t.l, c.Node(1), `COCKROACH_CONNECT_TIMEOUT=240 ./cockroach sql --insecure -e " SET TRACING = on; SELECT * FROM test.kv; SET TRACING = off;