From 44873ca24b54ce3e63a6b07e27b969d979f2186c Mon Sep 17 00:00:00 2001 From: Michael Butler Date: Mon, 6 Oct 2025 14:51:30 +0000 Subject: [PATCH] roachtest: deflake c2c/disconnect Previously, the c2c/disconnect roachtest was disconnecting to source nodes, instead of a pair of source/destination nodes. This patch fixes this bug. Informs: #152248 Informs: #150474 Release note: none --- pkg/cmd/roachtest/tests/cluster_to_cluster.go | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/pkg/cmd/roachtest/tests/cluster_to_cluster.go b/pkg/cmd/roachtest/tests/cluster_to_cluster.go index 95697b51b95b..e8630f99ca92 100644 --- a/pkg/cmd/roachtest/tests/cluster_to_cluster.go +++ b/pkg/cmd/roachtest/tests/cluster_to_cluster.go @@ -1757,9 +1757,11 @@ func registerClusterReplicationDisconnect(r registry.Registry) { var dstNode int srcTenantSQL.QueryRow(t, `select split_part(consumer, '[', 1) from crdb_internal.cluster_replication_node_streams order by random() limit 1`).Scan(&dstNode) + roachprodDstNode := dstNode + sp.srcNodes + disconnectDuration := sp.additionalDuration rd.t.L().Printf("Disconnecting Src %d, Dest %d for %.2f minutes", srcNode, - dstNode, disconnectDuration.Minutes()) + roachprodDstNode, disconnectDuration.Minutes()) // Normally, the blackholeFailer is accessed through the failer interface, // at least in the failover tests. Because this test shouldn't use all the @@ -1767,7 +1769,7 @@ func registerClusterReplicationDisconnect(r registry.Registry) { // blakholeFailer struct directly. In other words, in this test, we // shouldn't treat the blackholeFailer as an abstracted api. blackholeFailer := &blackholeFailer{t: rd.t, c: rd.c, input: true, output: true} - blackholeFailer.FailPartial(ctx, srcNode, []int{dstNode}) + blackholeFailer.FailPartial(ctx, srcNode, []int{roachprodDstNode}) time.Sleep(disconnectDuration) // Calling this will log the latest topology.