Skip to content

Commit 1e2f15b

Browse files
Fix flakiness in TestDisruptions for two pc testing (#17106)
Signed-off-by: Manan Gupta <manan@planetscale.com>
1 parent fdf529e commit 1e2f15b

File tree

2 files changed

+7
-1
lines changed

2 files changed

+7
-1
lines changed

go/test/endtoend/cluster/vtctldclient_process.go

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -195,7 +195,9 @@ func (vtctldclient *VtctldClientProcess) PlannedReparentShard(Keyspace string, S
195195
output, err := vtctldclient.ExecuteCommandWithOutput(
196196
"PlannedReparentShard",
197197
fmt.Sprintf("%s/%s", Keyspace, Shard),
198-
"--new-primary", alias)
198+
"--new-primary", alias,
199+
"--wait-replicas-timeout", "30s",
200+
)
199201
if err != nil {
200202
log.Errorf("error in PlannedReparentShard output %s, err %s", output, err.Error())
201203
}

go/test/endtoend/transaction/twopc/utils/utils.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -221,6 +221,10 @@ func AddShards(t *testing.T, clusterInstance *cluster.LocalProcessCluster, keysp
221221
shard, err := clusterInstance.AddShard(keyspaceName, shardName, 3, false, nil)
222222
require.NoError(t, err)
223223
clusterInstance.Keyspaces[0].Shards = append(clusterInstance.Keyspaces[0].Shards, *shard)
224+
for _, vttablet := range shard.Vttablets {
225+
err = vttablet.VttabletProcess.WaitForTabletStatuses([]string{"SERVING"})
226+
require.NoError(t, err)
227+
}
224228
}
225229
}
226230

0 commit comments

Comments
 (0)