Skip to content

Commit

Permalink
roachtest: use high connect timeout in election test
Browse files Browse the repository at this point in the history
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
  • Loading branch information
tbg committed Oct 23, 2018
1 parent d3f39a5 commit 20776ed
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion pkg/cmd/roachtest/election.go
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit 20776ed

Please sign in to comment.