Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

VReplication: Restore previous minimal e2e test behavior #17016

Merged
merged 1 commit into from
Oct 21, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,14 @@ import (

func testMoveTablesMirrorTraffic(t *testing.T, flavor workflowFlavor) {
setSidecarDBName("_vt")
ogReplicas := defaultReplicas
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nit: "og" naming in this function as compared with "orig" naming in other functions. I prefer the latter FWIW.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We are using this pattern cut-pasted in many places. This is going to be refactored soon into calling a function that changes the number of replica/rdonly count and returns a deferable reset function. (Or we will remove the globals and make them test-scoped)

So merging as-is for now to get the backport ready well in time for RC2.

ogRdOnly := defaultRdonly
defer func() {
defaultReplicas = ogReplicas
defaultRdonly = ogRdOnly
}()
defaultRdonly = 0
defaultReplicas = 0
vc = setupMinimalCluster(t)
defer vc.TearDown()

Expand Down
3 changes: 3 additions & 0 deletions go/test/endtoend/vreplication/partial_movetables_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
5 changes: 2 additions & 3 deletions go/test/endtoend/vreplication/vdiff_online_ddl_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down
Loading