From ced20103d40107c17494c878a9fc22c0c3e1834a Mon Sep 17 00:00:00 2001 From: Manan Gupta <35839558+GuptaManan100@users.noreply.github.com> Date: Mon, 4 Nov 2024 14:46:33 +0530 Subject: [PATCH] Fix flakiness in `TestDisruptions` for two pc testing (#17106) Signed-off-by: Manan Gupta --- go/test/endtoend/cluster/vtctldclient_process.go | 4 +++- go/test/endtoend/transaction/twopc/utils/utils.go | 4 ++++ 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/go/test/endtoend/cluster/vtctldclient_process.go b/go/test/endtoend/cluster/vtctldclient_process.go index 55f04e021c9..892f03e27fe 100644 --- a/go/test/endtoend/cluster/vtctldclient_process.go +++ b/go/test/endtoend/cluster/vtctldclient_process.go @@ -195,7 +195,9 @@ func (vtctldclient *VtctldClientProcess) PlannedReparentShard(Keyspace string, S output, err := vtctldclient.ExecuteCommandWithOutput( "PlannedReparentShard", fmt.Sprintf("%s/%s", Keyspace, Shard), - "--new-primary", alias) + "--new-primary", alias, + "--wait-replicas-timeout", "30s", + ) if err != nil { log.Errorf("error in PlannedReparentShard output %s, err %s", output, err.Error()) } diff --git a/go/test/endtoend/transaction/twopc/utils/utils.go b/go/test/endtoend/transaction/twopc/utils/utils.go index 067877c4ece..695dd0dd93f 100644 --- a/go/test/endtoend/transaction/twopc/utils/utils.go +++ b/go/test/endtoend/transaction/twopc/utils/utils.go @@ -221,6 +221,10 @@ func AddShards(t *testing.T, clusterInstance *cluster.LocalProcessCluster, keysp shard, err := clusterInstance.AddShard(keyspaceName, shardName, 3, false, nil) require.NoError(t, err) clusterInstance.Keyspaces[0].Shards = append(clusterInstance.Keyspaces[0].Shards, *shard) + for _, vttablet := range shard.Vttablets { + err = vttablet.VttabletProcess.WaitForTabletStatuses([]string{"SERVING"}) + require.NoError(t, err) + } } }