Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

release-23.1: server: increase timeout for TestClusterVersionUpgrade #101056

Merged
merged 1 commit into from
Apr 10, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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