From c5f0c0338352d2e69f42a2bd376a2fe79933a2c1 Mon Sep 17 00:00:00 2001 From: Matt Lord Date: Mon, 21 Oct 2024 02:28:58 -0400 Subject: [PATCH] VReplication: Restore previous minimal e2e test behavior (#17016) Signed-off-by: Matt Lord --- .../vreplication/movetables_mirrortraffic_test.go | 8 ++++++++ go/test/endtoend/vreplication/partial_movetables_test.go | 3 +++ go/test/endtoend/vreplication/vdiff_online_ddl_test.go | 5 ++--- .../vreplication/vreplication_vtctldclient_cli_test.go | 3 +++ 4 files changed, 16 insertions(+), 3 deletions(-) diff --git a/go/test/endtoend/vreplication/movetables_mirrortraffic_test.go b/go/test/endtoend/vreplication/movetables_mirrortraffic_test.go index 54e648de6b4..e0e7dbfc148 100644 --- a/go/test/endtoend/vreplication/movetables_mirrortraffic_test.go +++ b/go/test/endtoend/vreplication/movetables_mirrortraffic_test.go @@ -25,6 +25,14 @@ import ( func testMoveTablesMirrorTraffic(t *testing.T, flavor workflowFlavor) { setSidecarDBName("_vt") + ogReplicas := defaultReplicas + ogRdOnly := defaultRdonly + defer func() { + defaultReplicas = ogReplicas + defaultRdonly = ogRdOnly + }() + defaultRdonly = 0 + defaultReplicas = 0 vc = setupMinimalCluster(t) defer vc.TearDown() diff --git a/go/test/endtoend/vreplication/partial_movetables_test.go b/go/test/endtoend/vreplication/partial_movetables_test.go index b971a05a467..7ae8f83416d 100644 --- a/go/test/endtoend/vreplication/partial_movetables_test.go +++ b/go/test/endtoend/vreplication/partial_movetables_test.go @@ -83,10 +83,13 @@ func testCancel(t *testing.T) { func testPartialMoveTablesBasic(t *testing.T, flavor workflowFlavor) { setSidecarDBName("_vt") + origDefaultReplicas := defaultReplicas origDefaultRdonly := defaultRdonly defer func() { + defaultReplicas = origDefaultReplicas defaultRdonly = origDefaultRdonly }() + defaultReplicas = 0 defaultRdonly = 0 origExtraVTGateArgs := extraVTGateArgs // We need to enable shard routing for partial movetables routing. diff --git a/go/test/endtoend/vreplication/vdiff_online_ddl_test.go b/go/test/endtoend/vreplication/vdiff_online_ddl_test.go index 92977111294..0f3cda66ce6 100644 --- a/go/test/endtoend/vreplication/vdiff_online_ddl_test.go +++ b/go/test/endtoend/vreplication/vdiff_online_ddl_test.go @@ -23,13 +23,12 @@ func TestOnlineDDLVDiff(t *testing.T) { setSidecarDBName("_vt") originalRdonly := defaultRdonly originalReplicas := defaultReplicas - defaultRdonly = 0 - defaultReplicas = 0 defer func() { defaultRdonly = originalRdonly defaultReplicas = originalReplicas }() - + defaultRdonly = 0 + defaultReplicas = 0 vc = setupMinimalCluster(t) defer vc.TearDown() keyspace := "product" diff --git a/go/test/endtoend/vreplication/vreplication_vtctldclient_cli_test.go b/go/test/endtoend/vreplication/vreplication_vtctldclient_cli_test.go index 1dc07a90abc..4b556955815 100644 --- a/go/test/endtoend/vreplication/vreplication_vtctldclient_cli_test.go +++ b/go/test/endtoend/vreplication/vreplication_vtctldclient_cli_test.go @@ -46,10 +46,13 @@ import ( func TestVtctldclientCLI(t *testing.T) { setSidecarDBName("_vt") var err error + origDefaultReplicas := defaultReplicas origDefaultRdonly := defaultRdonly defer func() { + defaultReplicas = origDefaultReplicas defaultRdonly = origDefaultRdonly }() + defaultReplicas = 1 defaultRdonly = 0 vc = setupMinimalCluster(t) vttablet.InitVReplicationConfigDefaults()