From 9e18db68d2ebb17b45c0c5cafcf5c22fed4907d8 Mon Sep 17 00:00:00 2001 From: Rafi Shamim Date: Fri, 7 Apr 2023 11:56:05 -0400 Subject: [PATCH] server: increase timeout for TestClusterVersionUpgrade This has been flaking with a timeout. We can see that in each failure it's making a different amount of progress, so this just needs a bit more time. Release note: None --- pkg/server/version_cluster_test.go | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/pkg/server/version_cluster_test.go b/pkg/server/version_cluster_test.go index 5d925d3f876d..5430acf0bac1 100644 --- a/pkg/server/version_cluster_test.go +++ b/pkg/server/version_cluster_test.go @@ -17,6 +17,7 @@ import ( "path/filepath" "strconv" "testing" + "time" "github.com/cockroachdb/cockroach/pkg/base" "github.com/cockroachdb/cockroach/pkg/clusterversion" @@ -256,16 +257,16 @@ func TestClusterVersionUpgrade(t *testing.T) { } // Check the cluster version is bumped to newVersion. - testutils.SucceedsSoon(t, func() error { + testutils.SucceedsWithin(t, func() error { if version := tc.getVersionFromSelect(0); version != newVersion.String() { return errors.Errorf("cluster version is still %s, should be %s", version, newVersion) } return nil - }) + }, 3*time.Minute) curVersion = tc.getVersionFromSelect(0) isNoopUpdate := curVersion == newVersion.String() - testutils.SucceedsSoon(t, func() error { + testutils.SucceedsWithin(t, func() error { for i := 0; i < tc.NumServers(); i++ { st := tc.Servers[i].ClusterSettings() v := st.Version.ActiveVersion(ctx) @@ -279,14 +280,14 @@ func TestClusterVersionUpgrade(t *testing.T) { } } return nil - }) + }, 3*time.Minute) exp := newVersion.String() // Read the versions from the table from each node. Note that under the // hood, everything goes to the lease holder and so it's pretty much // guaranteed that they all read the same, but it doesn't hurt to check. - testutils.SucceedsSoon(t, func() error { + testutils.SucceedsWithin(t, func() error { for i := 0; i < tc.NumServers(); i++ { if version := tc.getVersionFromSelect(i); version != exp { return errors.Errorf("%d: incorrect version %q (wanted %s)", i, version, exp) @@ -296,13 +297,13 @@ func TestClusterVersionUpgrade(t *testing.T) { } } return nil - }) + }, 3*time.Minute) // Now check the Settings.Version variable. That is the tricky one for which // we "hold back" a gossip update until we've written to the engines. We may // have to wait a bit until we see the new version here, even though it's // already in the table. - testutils.SucceedsSoon(t, func() error { + testutils.SucceedsWithin(t, func() error { for i := 0; i < tc.NumServers(); i++ { vers := tc.Servers[i].ClusterSettings().Version.ActiveVersion(ctx) if v := vers.String(); v == curVersion { @@ -315,7 +316,7 @@ func TestClusterVersionUpgrade(t *testing.T) { } } return nil - }) + }, 3*time.Minute) // Since the wrapped version setting exposes the new versions, it must // definitely be present on all stores on the first try.