Skip to content

Commit 8814b32

Browse files
committed
server: call WaitFor5NodeReplication in TestCheckRestartSafe
This test should call the more specialized method to avoid timing out when we're waiting for 5 nodes to replicate. Epic: None Resolves: #153523 Release note: None
1 parent 378e7c3 commit 8814b32

File tree

2 files changed

+10
-1
lines changed

2 files changed

+10
-1
lines changed

pkg/server/api_v2_test.go

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -444,7 +444,11 @@ func updateAllReplicaCounts(
444444
) {
445445
_, err := testCluster.ServerConn(0).Exec("ALTER RANGE default CONFIGURE ZONE USING num_replicas=$1", desiredVoters)
446446
require.NoError(t, err)
447-
require.NoError(t, testCluster.WaitForFullReplication())
447+
if desiredVoters == 5 {
448+
require.NoError(t, testCluster.WaitFor5NodeReplication())
449+
} else {
450+
require.NoError(t, testCluster.WaitForFullReplication())
451+
}
448452

449453
ts0 := testCluster.Server(0)
450454
stores := ts0.GetStores().(storeVisitor)

pkg/testutils/serverutils/test_cluster_shim.go

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -239,6 +239,11 @@ type TestClusterInterface interface {
239239
// have no ranges with replication pending.
240240
WaitForFullReplication() error
241241

242+
// WaitFor5NodeReplication ensures that zone configs are applied and
243+
// up-replication is performed with new zone configs. This is the case for 5+
244+
// node clusters.
245+
WaitFor5NodeReplication() error
246+
242247
// StartedDefaultTestTenant returns whether this cluster started a
243248
// default tenant for testing.
244249
StartedDefaultTestTenant() bool

0 commit comments

Comments
 (0)