Skip to content

Commit

Permalink
Move all e2e tests to vtctldclient
Browse files Browse the repository at this point in the history
Signed-off-by: Matt Lord <[email protected]>
  • Loading branch information
mattlord committed Dec 26, 2024
1 parent 30e1e40 commit e5d68d7
Show file tree
Hide file tree
Showing 28 changed files with 253 additions and 616 deletions.
64 changes: 32 additions & 32 deletions go/test/endtoend/keyspace/keyspace_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -277,24 +277,24 @@ func TestDeleteKeyspace(t *testing.T) {
// TODO: (ajm188) if this test gets fixed, the flags need to be updated to comply with VEP-4 as well.
// tells that in zone2 after deleting shard, there is no shard #264 and in zone1 there is only 1 #269
/*func RemoveKeyspaceCell(t *testing.T) {
_ = clusterForKSTest.VtctlclientProcess.ExecuteCommand("CreateKeyspace", "test_delete_keyspace_removekscell")
_ = clusterForKSTest.VtctlclientProcess.ExecuteCommand("CreateShard", "test_delete_keyspace_removekscell/0")
_ = clusterForKSTest.VtctlclientProcess.ExecuteCommand("CreateShard", "test_delete_keyspace_removekscell/1")
_ = clusterForKSTest.VtctlclientProcess.ExecuteCommand("InitTablet", "--port=1234", "--bind-address=127.0.0.1", "-keyspace=test_delete_keyspace_removekscell", "--shard=0", "zone1-0000000100", "primary")
_ = clusterForKSTest.VtctlclientProcess.ExecuteCommand("InitTablet", "--port=1234", "--bind-address=127.0.0.1", "-keyspace=test_delete_keyspace_removekscell", "--shard=1", "zone1-0000000101", "primary")
_ = clusterForKSTest.VtctlclientProcess.ExecuteCommand("InitTablet", "--port=1234", "--bind-address=127.0.0.1", "-keyspace=test_delete_keyspace_removekscell", "--shard=0", "zone2-0000000100", "replica")
_ = clusterForKSTest.VtctlclientProcess.ExecuteCommand("InitTablet", "--port=1234", "--bind-address=127.0.0.1", "-keyspace=test_delete_keyspace_removekscell", "--shard=1", "zone2-0000000101", "replica")
_ = clusterForKSTest.VtctldClientProcess.ExecuteCommand("CreateKeyspace", "test_delete_keyspace_removekscell")
_ = clusterForKSTest.VtctldClientProcess.ExecuteCommand("CreateShard", "test_delete_keyspace_removekscell/0")
_ = clusterForKSTest.VtctldClientProcess.ExecuteCommand("CreateShard", "test_delete_keyspace_removekscell/1")
_ = clusterForKSTest.VtctldClientProcess.ExecuteCommand("InitTablet", "--port=1234", "--bind-address=127.0.0.1", "-keyspace=test_delete_keyspace_removekscell", "--shard=0", "zone1-0000000100", "primary")
_ = clusterForKSTest.VtctldClientProcess.ExecuteCommand("InitTablet", "--port=1234", "--bind-address=127.0.0.1", "-keyspace=test_delete_keyspace_removekscell", "--shard=1", "zone1-0000000101", "primary")
_ = clusterForKSTest.VtctldClientProcess.ExecuteCommand("InitTablet", "--port=1234", "--bind-address=127.0.0.1", "-keyspace=test_delete_keyspace_removekscell", "--shard=0", "zone2-0000000100", "replica")
_ = clusterForKSTest.VtctldClientProcess.ExecuteCommand("InitTablet", "--port=1234", "--bind-address=127.0.0.1", "-keyspace=test_delete_keyspace_removekscell", "--shard=1", "zone2-0000000101", "replica")
// Create the serving/replication entries and check that they exist, so we can later check they're deleted.
_ = clusterForKSTest.VtctlclientProcess.ExecuteCommand("RebuildKeyspaceGraph", "test_delete_keyspace_removekscell")
_ = clusterForKSTest.VtctlclientProcess.ExecuteCommand("GetShardReplication", "zone2", "test_delete_keyspace_removekscell/0")
_ = clusterForKSTest.VtctlclientProcess.ExecuteCommand("GetShardReplication", "zone2", "test_delete_keyspace_removekscell/1")
_ = clusterForKSTest.VtctlclientProcess.ExecuteCommand("GetSrvKeyspace", "zone2", "test_delete_keyspace_removekscell")
_ = clusterForKSTest.VtctlclientProcess.ExecuteCommand("GetSrvKeyspace", "zone1", "test_delete_keyspace_removekscell")
_ = clusterForKSTest.VtctldClientProcess.ExecuteCommand("RebuildKeyspaceGraph", "test_delete_keyspace_removekscell")
_ = clusterForKSTest.VtctldClientProcess.ExecuteCommand("GetShardReplication", "zone2", "test_delete_keyspace_removekscell/0")
_ = clusterForKSTest.VtctldClientProcess.ExecuteCommand("GetShardReplication", "zone2", "test_delete_keyspace_removekscell/1")
_ = clusterForKSTest.VtctldClientProcess.ExecuteCommand("GetSrvKeyspace", "zone2", "test_delete_keyspace_removekscell")
_ = clusterForKSTest.VtctldClientProcess.ExecuteCommand("GetSrvKeyspace", "zone1", "test_delete_keyspace_removekscell")
// Just remove the shard from one cell (including tablets),
// but leaving the global records and other cells/shards alone.
_ = clusterForKSTest.VtctlclientProcess.ExecuteCommand("RemoveShardCell", "--recursive", "test_delete_keyspace_removekscell/0", "zone2")
_ = clusterForKSTest.VtctldClientProcess.ExecuteCommand("RemoveShardCell", "--recursive", "test_delete_keyspace_removekscell/0", "zone2")
//Check that the shard is gone from zone2.
srvKeyspaceZone2 := getSrvKeyspace(t, cell2, "test_delete_keyspace_removekscell")
Expand All @@ -308,42 +308,42 @@ func TestDeleteKeyspace(t *testing.T) {
assert.Equal(t, len(partition.ShardReferences), 2)
}
_ = clusterForKSTest.VtctlclientProcess.ExecuteCommand("RebuildKeyspaceGraph", "test_delete_keyspace_removekscell")
_ = clusterForKSTest.VtctlclientProcess.ExecuteCommand("GetKeyspace", "test_delete_keyspace_removekscell")
_ = clusterForKSTest.VtctlclientProcess.ExecuteCommand("GetShard", "test_delete_keyspace_removekscell/0")
_ = clusterForKSTest.VtctldClientProcess.ExecuteCommand("RebuildKeyspaceGraph", "test_delete_keyspace_removekscell")
_ = clusterForKSTest.VtctldClientProcess.ExecuteCommand("GetKeyspace", "test_delete_keyspace_removekscell")
_ = clusterForKSTest.VtctldClientProcess.ExecuteCommand("GetShard", "test_delete_keyspace_removekscell/0")
_ = clusterForKSTest.VtctlclientProcess.ExecuteCommand("GetTablet", "zone1-0000000100")
_ = clusterForKSTest.VtctldClientProcess.ExecuteCommand("GetTablet", "zone1-0000000100")
err := clusterForKSTest.VtctlclientProcess.ExecuteCommand("GetTablet", "zone2-0000000100")
err := clusterForKSTest.VtctldClientProcess.ExecuteCommand("GetTablet", "zone2-0000000100")
require.Error(t, err)
_ = clusterForKSTest.VtctlclientProcess.ExecuteCommand("GetTablet", "zone2-0000000101")
_ = clusterForKSTest.VtctlclientProcess.ExecuteCommand("GetShardReplication", "zone1", "test_delete_keyspace_removekscell/0")
_ = clusterForKSTest.VtctldClientProcess.ExecuteCommand("GetTablet", "zone2-0000000101")
_ = clusterForKSTest.VtctldClientProcess.ExecuteCommand("GetShardReplication", "zone1", "test_delete_keyspace_removekscell/0")
err = clusterForKSTest.VtctlclientProcess.ExecuteCommand("GetShardReplication", "zone2", "test_delete_keyspace_removekscell/0")
err = clusterForKSTest.VtctldClientProcess.ExecuteCommand("GetShardReplication", "zone2", "test_delete_keyspace_removekscell/0")
require.Error(t, err)
_ = clusterForKSTest.VtctlclientProcess.ExecuteCommand("GetShardReplication", "zone2", "test_delete_keyspace_removekscell/1")
_ = clusterForKSTest.VtctlclientProcess.ExecuteCommand("GetSrvKeyspace", "zone2", "test_delete_keyspace_removekscell")
_ = clusterForKSTest.VtctldClientProcess.ExecuteCommand("GetShardReplication", "zone2", "test_delete_keyspace_removekscell/1")
_ = clusterForKSTest.VtctldClientProcess.ExecuteCommand("GetSrvKeyspace", "zone2", "test_delete_keyspace_removekscell")
// Add it back to do another test.
_ = clusterForKSTest.VtctlclientProcess.ExecuteCommand("InitTablet", "--port=1234", "--keyspace=test_delete_keyspace_removekscell", "--shard=0", "zone2-0000000100", "replica")
_ = clusterForKSTest.VtctlclientProcess.ExecuteCommand("RebuildKeyspaceGraph", "test_delete_keyspace_removekscell")
_ = clusterForKSTest.VtctlclientProcess.ExecuteCommand("GetShardReplication", "zone2", "test_delete_keyspace_removekscell/0")
_ = clusterForKSTest.VtctldClientProcess.ExecuteCommand("InitTablet", "--port=1234", "--keyspace=test_delete_keyspace_removekscell", "--shard=0", "zone2-0000000100", "replica")
_ = clusterForKSTest.VtctldClientProcess.ExecuteCommand("RebuildKeyspaceGraph", "test_delete_keyspace_removekscell")
_ = clusterForKSTest.VtctldClientProcess.ExecuteCommand("GetShardReplication", "zone2", "test_delete_keyspace_removekscell/0")
// Now use RemoveKeyspaceCell to remove all shards.
_ = clusterForKSTest.VtctlclientProcess.ExecuteCommand("RemoveKeyspaceCell", "-recursive", "test_delete_keyspace_removekscell", "zone2")
_ = clusterForKSTest.VtctlclientProcess.ExecuteCommand("RebuildKeyspaceGraph", "test_delete_keyspace_removekscell")
_ = clusterForKSTest.VtctlclientProcess.ExecuteCommand("GetShardReplication", "zone1", "test_delete_keyspace_removekscell/0")
_ = clusterForKSTest.VtctldClientProcess.ExecuteCommand("RemoveKeyspaceCell", "-recursive", "test_delete_keyspace_removekscell", "zone2")
_ = clusterForKSTest.VtctldClientProcess.ExecuteCommand("RebuildKeyspaceGraph", "test_delete_keyspace_removekscell")
_ = clusterForKSTest.VtctldClientProcess.ExecuteCommand("GetShardReplication", "zone1", "test_delete_keyspace_removekscell/0")
err = clusterForKSTest.VtctlclientProcess.ExecuteCommand("GetShardReplication", "zone2", "test_delete_keyspace_removekscell/0")
err = clusterForKSTest.VtctldClientProcess.ExecuteCommand("GetShardReplication", "zone2", "test_delete_keyspace_removekscell/0")
require.Error(t, err)
err = clusterForKSTest.VtctlclientProcess.ExecuteCommand("GetShardReplication", "zone2", "test_delete_keyspace_removekscell/1")
err = clusterForKSTest.VtctldClientProcess.ExecuteCommand("GetShardReplication", "zone2", "test_delete_keyspace_removekscell/1")
require.Error(t, err)
// Clean up
_ = clusterForKSTest.VtctlclientProcess.ExecuteCommand("DeleteKeyspace", "-recursive", "test_delete_keyspace_removekscell")
_ = clusterForKSTest.VtctldClientProcess.ExecuteCommand("DeleteKeyspace", "-recursive", "test_delete_keyspace_removekscell")
} */

func TestShardCountForAllKeyspaces(t *testing.T) {
Expand Down
2 changes: 1 addition & 1 deletion go/test/endtoend/reparent/utils/utils.go
Original file line number Diff line number Diff line change
Expand Up @@ -677,7 +677,7 @@ func CheckReparentFromOutside(t *testing.T, clusterInstance *cluster.LocalProces
assert.Len(t, result[cell1].Nodes, 2)
}
} else {
result, err := clusterInstance.VtctlclientProcess.ExecuteCommandWithOutput("GetShardReplication", cell1, KeyspaceShard)
result, err := clusterInstance.VtctldClientProcess.ExecuteCommandWithOutput("GetShardReplication", cell1, KeyspaceShard)
require.Nil(t, err, "error should be Nil")
if !downPrimary {
assertNodeCount(t, result, int(3))
Expand Down
10 changes: 5 additions & 5 deletions go/test/endtoend/sharded/sharded_keyspace_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -147,13 +147,13 @@ func TestShardedKeyspace(t *testing.T) {
require.Nil(t, err)
assert.Equal(t, `[[INT64(1) VARCHAR("test 1")]]`, fmt.Sprintf("%v", rows.Rows))

err = clusterInstance.VtctlclientProcess.ExecuteCommand("ValidateSchemaShard", fmt.Sprintf("%s/%s", keyspaceName, shard1.Name))
err = clusterInstance.VtctldClientProcess.ExecuteCommand("ValidateSchemaShard", fmt.Sprintf("%s/%s", keyspaceName, shard1.Name))
require.Nil(t, err)

err = clusterInstance.VtctlclientProcess.ExecuteCommand("ValidateSchemaShard", fmt.Sprintf("%s/%s", keyspaceName, shard1.Name))
err = clusterInstance.VtctldClientProcess.ExecuteCommand("ValidateSchemaShard", fmt.Sprintf("%s/%s", keyspaceName, shard1.Name))
require.Nil(t, err)

output, err := clusterInstance.VtctlclientProcess.ExecuteCommandWithOutput("ValidateSchemaKeyspace", keyspaceName)
output, err := clusterInstance.VtctldClientProcess.ExecuteCommandWithOutput("ValidateSchemaKeyspace", keyspaceName)
require.Error(t, err)
// We should assert that there is a schema difference and that both the shard primaries are involved in it.
// However, we cannot assert in which order the two primaries will occur since the underlying function does not guarantee that
Expand All @@ -166,9 +166,9 @@ func TestShardedKeyspace(t *testing.T) {
require.Nil(t, err)
err = clusterInstance.VtctldClientProcess.ExecuteCommand("GetPermissions", shard1.Vttablets[1].Alias)
require.Nil(t, err)
err = clusterInstance.VtctlclientProcess.ExecuteCommand("ValidatePermissionsShard", fmt.Sprintf("%s/%s", keyspaceName, shard1.Name))
err = clusterInstance.VtctldClientProcess.ExecuteCommand("ValidatePermissionsShard", fmt.Sprintf("%s/%s", keyspaceName, shard1.Name))
require.Nil(t, err)
err = clusterInstance.VtctlclientProcess.ExecuteCommand("ValidatePermissionsKeyspace", keyspaceName)
err = clusterInstance.VtctldClientProcess.ExecuteCommand("ValidatePermissionsKeyspace", keyspaceName)
require.Nil(t, err)

rows, err = shard1Primary.VttabletProcess.QueryTablet("select id, msg from vt_select_test order by id", keyspaceName, true)
Expand Down
24 changes: 10 additions & 14 deletions go/test/endtoend/vreplication/fk_ext_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -151,8 +151,7 @@ func TestFKExt(t *testing.T) {
}
sqls := strings.Split(FKExtSourceSchema, "\n")
for _, sql := range sqls {
output, err := vc.VtctlClient.ExecuteCommandWithOutput("ApplySchema", "--",
"--ddl_strategy=direct", "--sql", sql, keyspaceName)
output, err := vc.VtctldClient.ExecuteCommandWithOutput("ApplySchema", "--ddl-strategy=direct", "--sql", sql, keyspaceName)
require.NoErrorf(t, err, output)
}
doReshard(t, fkextConfig.target2KeyspaceName, "reshard2to3", "-80,80-", threeShards, tablets)
Expand All @@ -165,8 +164,7 @@ func TestFKExt(t *testing.T) {
tablets[shard] = vc.Cells[cellName].Keyspaces[keyspaceName].Shards[shard].Tablets[fmt.Sprintf("%s-%d", cellName, tabletID)].Vttablet
sqls := strings.Split(FKExtSourceSchema, "\n")
for _, sql := range sqls {
output, err := vc.VtctlClient.ExecuteCommandWithOutput("ApplySchema", "--",
"--ddl_strategy=direct", "--sql", sql, keyspaceName)
output, err := vc.VtctldClient.ExecuteCommandWithOutput("ApplySchema", "--ddl-strategy=direct", "--sql", sql, keyspaceName)
require.NoErrorf(t, err, output)
}
doReshard(t, fkextConfig.target2KeyspaceName, "reshard3to1", threeShards, "0", tablets)
Expand Down Expand Up @@ -254,7 +252,7 @@ func doReshard(t *testing.T, keyspace, workflowName, sourceShards, targetShards
for _, targetTab := range targetTabs {
catchup(t, targetTab, workflowName, "Reshard")
}
vdiff(t, keyspace, workflowName, fkextConfig.cell, false, true, nil)
vdiff(t, keyspace, workflowName, fkextConfig.cell, nil)
rs.SwitchReadsAndWrites()
//if lg.WaitForAdditionalRows(100) != nil {
// t.Fatal("WaitForAdditionalRows failed")
Expand All @@ -263,7 +261,7 @@ func doReshard(t *testing.T, keyspace, workflowName, sourceShards, targetShards
if compareRowCounts(t, keyspace, strings.Split(sourceShards, ","), strings.Split(targetShards, ",")) != nil {
t.Fatal("Row counts do not match")
}
vdiff(t, keyspace, workflowName+"_reverse", fkextConfig.cell, true, false, nil)
vdiff(t, keyspace, workflowName+"_reverse", fkextConfig.cell, nil)

rs.ReverseReadsAndWrites()
//if lg.WaitForAdditionalRows(100) != nil {
Expand All @@ -273,7 +271,7 @@ func doReshard(t *testing.T, keyspace, workflowName, sourceShards, targetShards
if compareRowCounts(t, keyspace, strings.Split(targetShards, ","), strings.Split(sourceShards, ",")) != nil {
t.Fatal("Row counts do not match")
}
vdiff(t, keyspace, workflowName, fkextConfig.cell, false, true, nil)
vdiff(t, keyspace, workflowName, fkextConfig.cell, nil)
lg.Stop()

rs.SwitchReadsAndWrites()
Expand Down Expand Up @@ -313,12 +311,10 @@ const fkExtMaterializeSpec = `

func materializeTables(t *testing.T) {
wfName := "mat"
err := vc.VtctlClient.ExecuteCommand("ApplySchema", "--", "--ddl_strategy=direct",
"--sql", FKExtMaterializeSchema, fkextConfig.target1KeyspaceName)
err := vc.VtctldClient.ExecuteCommand("ApplySchema", "--ddl-strategy=direct", "--sql", FKExtMaterializeSchema, fkextConfig.target1KeyspaceName)
require.NoError(t, err, fmt.Sprintf("ApplySchema Error: %s", err))
materializeSpec := fmt.Sprintf(fkExtMaterializeSpec, "mat", fkextConfig.target2KeyspaceName, fkextConfig.target1KeyspaceName)
err = vc.VtctlClient.ExecuteCommand("Materialize", materializeSpec)
require.NoError(t, err, "Materialize")
materialize(t, materializeSpec)
tab := vc.getPrimaryTablet(t, fkextConfig.target1KeyspaceName, "0")
catchup(t, tab, wfName, "Materialize")
validateMaterializeRowCounts(t)
Expand Down Expand Up @@ -363,7 +359,7 @@ func doMoveTables(t *testing.T, sourceKeyspace, targetKeyspace, workflowName, ta
for _, targetTab := range targetTabs {
catchup(t, targetTab, workflowName, "MoveTables")
}
vdiff(t, targetKeyspace, workflowName, fkextConfig.cell, false, true, nil)
vdiff(t, targetKeyspace, workflowName, fkextConfig.cell, nil)
lg.Stop()
lg.SetDBStrategy("vtgate", targetKeyspace)
if lg.Start() != nil {
Expand All @@ -377,7 +373,7 @@ func doMoveTables(t *testing.T, sourceKeyspace, targetKeyspace, workflowName, ta
}

waitForLowLag(t, sourceKeyspace, workflowName+"_reverse")
vdiff(t, sourceKeyspace, workflowName+"_reverse", fkextConfig.cell, false, true, nil)
vdiff(t, sourceKeyspace, workflowName+"_reverse", fkextConfig.cell, nil)
if lg.WaitForAdditionalRows(100) != nil {
t.Fatal("WaitForAdditionalRows failed")
}
Expand All @@ -388,7 +384,7 @@ func doMoveTables(t *testing.T, sourceKeyspace, targetKeyspace, workflowName, ta
}
waitForLowLag(t, targetKeyspace, workflowName)
time.Sleep(5 * time.Second)
vdiff(t, targetKeyspace, workflowName, fkextConfig.cell, false, true, nil)
vdiff(t, targetKeyspace, workflowName, fkextConfig.cell, nil)
lg.Stop()
mt.SwitchReadsAndWrites()
mt.Complete()
Expand Down
4 changes: 2 additions & 2 deletions go/test/endtoend/vreplication/fk_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -102,11 +102,11 @@ func TestFKWorkflow(t *testing.T) {
targetTab := targetKs.Shards["0"].Tablets[fmt.Sprintf("%s-%d", cellName, targetTabletId)].Vttablet
require.NotNil(t, targetTab)
catchup(t, targetTab, workflowName, "MoveTables")
vdiff(t, targetKeyspace, workflowName, cellName, true, false, nil)
vdiff(t, targetKeyspace, workflowName, cellName, nil)
if withLoad {
ls.waitForAdditionalRows(200)
}
vdiff(t, targetKeyspace, workflowName, cellName, true, false, nil)
vdiff(t, targetKeyspace, workflowName, cellName, nil)
if withLoad {
cancel()
<-ch
Expand Down
27 changes: 8 additions & 19 deletions go/test/endtoend/vreplication/materialize_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ const smMaterializeSpec = `{"workflow": "wf1", "source_keyspace": "ks1", "target
const initDataQuery = `insert into ks1.tx(id, typ, val) values (1, 1, 'abc'), (2, 1, 'def'), (3, 2, 'def'), (4, 2, 'abc'), (5, 3, 'def'), (6, 3, 'abc')`

// testShardedMaterialize tests a materialize workflow for a sharded cluster (single shard) using comparison filters
func testShardedMaterialize(t *testing.T, useVtctldClient bool) {
func testShardedMaterialize(t *testing.T) {
var err error
vc = NewVitessCluster(t, nil)
ks1 := "ks1"
Expand All @@ -81,7 +81,7 @@ func testShardedMaterialize(t *testing.T, useVtctldClient bool) {
verifyClusterHealth(t, vc)
_, err = vtgateConn.ExecuteFetch(initDataQuery, 0, false)
require.NoError(t, err)
materialize(t, smMaterializeSpec, useVtctldClient)
materialize(t, smMaterializeSpec)
tab := vc.getPrimaryTablet(t, ks2, "0")
catchup(t, tab, "wf1", "Materialize")

Expand Down Expand Up @@ -169,7 +169,7 @@ DETERMINISTIC
RETURN id * length(val);
`

func testMaterialize(t *testing.T, useVtctldClient bool) {
func testMaterialize(t *testing.T) {
var err error
vc = NewVitessCluster(t, nil)
sourceKs := "source"
Expand Down Expand Up @@ -199,7 +199,7 @@ func testMaterialize(t *testing.T, useVtctldClient bool) {

testMaterializeWithNonExistentTable(t)

materialize(t, smMaterializeSpec2, useVtctldClient)
materialize(t, smMaterializeSpec2)
catchup(t, ks2Primary, "wf1", "Materialize")

// validate data after the copy phase
Expand All @@ -219,21 +219,10 @@ func testMaterialize(t *testing.T, useVtctldClient bool) {
// TestMaterialize runs all the individual materialize tests defined above.
func TestMaterialize(t *testing.T) {
t.Run("Materialize", func(t *testing.T) {
testMaterialize(t, false)
testMaterialize(t)
})
t.Run("ShardedMaterialize", func(t *testing.T) {
testShardedMaterialize(t, false)
})
}

// TestMaterializeVtctldClient runs all the individual materialize tests
// defined above using vtctldclient instead of vtctlclient.
func TestMaterializeVtctldClient(t *testing.T) {
t.Run("Materialize", func(t *testing.T) {
testMaterialize(t, true)
})
t.Run("ShardedMaterialize", func(t *testing.T) {
testShardedMaterialize(t, true)
testShardedMaterialize(t)
})
}

Expand Down Expand Up @@ -315,7 +304,7 @@ func TestReferenceTableMaterialize(t *testing.T) {
waitForQueryResult(t, vtgateConn, "ks2:"+shard, "select id, id2 from ref2",
`[[INT64(1) INT64(1)] [INT64(2) INT64(2)] [INT64(3) INT64(3)]]`)
}
vdiff(t, "ks2", "wf1", defaultCellName, false, true, nil)
vdiff(t, "ks2", "wf1", defaultCellName, nil)

queries := []string{
"update ks1.ref1 set val='xyz'",
Expand All @@ -332,5 +321,5 @@ func TestReferenceTableMaterialize(t *testing.T) {
waitForRowCount(t, vtgateConn, "ks2:"+shard, "ref1", 4)
waitForRowCount(t, vtgateConn, "ks2:"+shard, "ref2", 4)
}
vdiff(t, "ks2", "wf1", defaultCellName, false, true, nil)
vdiff(t, "ks2", "wf1", defaultCellName, nil)
}
Loading

0 comments on commit e5d68d7

Please sign in to comment.