Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
100922: server: increase timeout for TestClusterVersionUpgrade r=knz a=rafiss

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.

backport fixes cockroachdb#99784

Release note: None

Co-authored-by: Rafi Shamim <[email protected]>
  • Loading branch information
craig[bot] and rafiss committed Apr 10, 2023
2 parents f59767c + 9e18db6 commit b36c119
Showing 1 changed file with 9 additions and 8 deletions.
17 changes: 9 additions & 8 deletions pkg/server/version_cluster_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ import (
"path/filepath"
"strconv"
"testing"
"time"

"github.com/cockroachdb/cockroach/pkg/base"
"github.com/cockroachdb/cockroach/pkg/clusterversion"
Expand Down Expand Up @@ -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)
Expand All @@ -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)
Expand All @@ -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 {
Expand All @@ -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.
Expand Down

0 comments on commit b36c119

Please sign in to comment.