From 4fd268ddd3abf4e4864eb032b27ad4a20cdb7bc6 Mon Sep 17 00:00:00 2001 From: Tobias Grieger Date: Fri, 24 Mar 2023 15:20:33 +0100 Subject: [PATCH] roachtest: deflake autoupgrade Similar to: https://github.com/cockroachdb/cockroach/pull/99162/files#r1147643803 Fixes https://github.com/cockroachdb/cockroach/issues/99459. Epic: none Release note: None --- pkg/cmd/roachtest/tests/autoupgrade.go | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/pkg/cmd/roachtest/tests/autoupgrade.go b/pkg/cmd/roachtest/tests/autoupgrade.go index 416dfa9bc3b6..f7ecbffc46f4 100644 --- a/pkg/cmd/roachtest/tests/autoupgrade.go +++ b/pkg/cmd/roachtest/tests/autoupgrade.go @@ -86,7 +86,10 @@ func registerAutoUpgrade(r registry.Registry) { clusterVersion := func() (string, error) { var version string - if err := db.QueryRowContext(ctx, `SHOW CLUSTER SETTING version`).Scan(&version); err != nil { + // NB:`SHOW CLUSTER SETTING version` can block when in the middle of + // migrating and then fail because it has an internal timeout. + // See: https://github.com/cockroachdb/cockroach/issues/99115 + if err := db.QueryRowContext(ctx, `SELECT value FROM [SHOW CLUSTER SETTINGS] WHERE variable='version'`).Scan(&version); err != nil { return "", errors.Wrap(err, "determining cluster version") } return version, nil