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

e2e: deflake sharding tests #6715

Merged
merged 1 commit into from
Sep 15, 2020
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
21 changes: 7 additions & 14 deletions go/test/endtoend/cluster/vtctlclient_process.go
Original file line number Diff line number Diff line change
Expand Up @@ -66,20 +66,13 @@ func (vtctlclient *VtctlClientProcess) ApplyVSchema(Keyspace string, JSON string

// ExecuteCommand executes any vtctlclient command
func (vtctlclient *VtctlClientProcess) ExecuteCommand(args ...string) (err error) {
pArgs := []string{"-server", vtctlclient.Server}

if *isCoverage {
pArgs = append(pArgs, "-test.coverprofile="+getCoveragePath("vtctlclient-"+args[0]+".out"), "-test.v")
}
pArgs = append(pArgs, args...)
tmpProcess := exec.Command(
vtctlclient.Binary,
pArgs...,
)
log.Infof("Executing vtctlclient with command: %v", strings.Join(tmpProcess.Args, " "))
output, err := tmpProcess.Output()
if err != nil {
log.Errorf("Error executing %s: output %s, err %v", strings.Join(tmpProcess.Args, " "), output, err)
output, err := vtctlclient.ExecuteCommandWithOutput(args...)
if output != "" {
if err != nil {
log.Errorf("Output:\n%v", output)
} else {
log.Infof("Output:\n%v", output)
}
}
return err
}
Expand Down
8 changes: 0 additions & 8 deletions go/test/endtoend/sharding/base_sharding.go
Original file line number Diff line number Diff line change
Expand Up @@ -328,14 +328,6 @@ func checkLots(t *testing.T, vttablet cluster.Vttablet, count uint64, table stri
return float64(float64(totalFound) * 100 / float64(count) / 2)
}

// CheckRunningBinlogPlayer Checks binlog player is running and showing in status
func CheckRunningBinlogPlayer(t *testing.T, vttablet cluster.Vttablet, numberOfQueries int, numberOfTxns int) {
status := vttablet.VttabletProcess.GetStatus()
assert.Contains(t, status, "VReplication state: Open")
assert.Contains(t, status, fmt.Sprintf("<td><b>All</b>: %d<br><b>Query</b>: %d<br><b>Transaction</b>: %d<br></td>", numberOfQueries+numberOfTxns, numberOfQueries, numberOfTxns))
assert.Contains(t, status, "</html>")
}

// CheckTabletQueryServices check that the query service is enabled or disabled on the specified tablets.
func CheckTabletQueryServices(t *testing.T, vttablets []cluster.Vttablet, expectedStatus string, tabletControlEnabled bool, ci cluster.LocalProcessCluster) {
for _, tablet := range vttablets {
Expand Down
9 changes: 0 additions & 9 deletions go/test/endtoend/sharding/initialsharding/sharding_util.go
Original file line number Diff line number Diff line change
Expand Up @@ -512,15 +512,6 @@ func TestInitialSharding(t *testing.T, keyspace *cluster.Keyspace, keyType query
}
}

if isExternal {
// get status for the destination master tablet, make sure we have it all
sharding.CheckRunningBinlogPlayer(t, *shard21.MasterTablet(), 3956, 2002)
sharding.CheckRunningBinlogPlayer(t, *shard22.MasterTablet(), 4048, 2002)
} else {
sharding.CheckRunningBinlogPlayer(t, *shard21.MasterTablet(), 3954, 2000)
sharding.CheckRunningBinlogPlayer(t, *shard22.MasterTablet(), 4046, 2000)
}

// check we can't migrate the master just yet
err = ClusterInstance.VtctlclientProcess.ExecuteCommand("MigrateServedTypes", shard1Ks, "master")
require.Error(t, err)
Expand Down
3 changes: 0 additions & 3 deletions go/test/endtoend/sharding/mergesharding/mergesharding_base.go
Original file line number Diff line number Diff line change
Expand Up @@ -413,9 +413,6 @@ func TestMergesharding(t *testing.T, useVarbinaryShardingKeyType bool) {
err = clusterInstance.VtctlclientProcess.ExecuteCommand("ChangeSlaveType", shard3Rdonly.Alias, "rdonly")
require.NoError(t, err)

// get status for destination master tablets, make sure we have it all
sharding.CheckRunningBinlogPlayer(t, *shard3Master, 300, 100)

sharding.CheckTabletQueryService(t, *shard3Master, "NOT_SERVING", false, *clusterInstance)
streamHealth, err := clusterInstance.VtctlclientProcess.ExecuteCommandWithOutput(
"VtTabletStreamHealth",
Expand Down
4 changes: 0 additions & 4 deletions go/test/endtoend/sharding/resharding/resharding_base.go
Original file line number Diff line number Diff line change
Expand Up @@ -590,10 +590,6 @@ func TestResharding(t *testing.T, useVarbinaryShardingKeyType bool) {
err = clusterInstance.VtctlclientProcess.ExecuteCommand("ChangeSlaveType", shard3Rdonly.Alias, "rdonly")
require.Nil(t, err)

// get status for destination master tablets, make sure we have it all
sharding.CheckRunningBinlogPlayer(t, *shard2Master, 436, 216)
sharding.CheckRunningBinlogPlayer(t, *shard3Master, 456, 216)

// tests a failover switching serving to a different replica
err = clusterInstance.VtctlclientProcess.ExecuteCommand("ChangeSlaveType", shard1Replica2.Alias, "replica")
require.Nil(t, err)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -290,9 +290,6 @@ func TestVerticalSplit(t *testing.T) {
"destination_keyspace/0")
require.NoError(t, err)

// get status for destination master tablet, make sure we have it all
sharding.CheckRunningBinlogPlayer(t, destinationMasterTablet, 700, 300)

// check query service is off on destination master, as filtered
// replication is enabled. Even health check should not interfere.
destinationMasterTabletVars := destinationMasterTablet.VttabletProcess.GetVars()
Expand Down