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

Fix TestLeftJoinUsingUnsharded and remove instability when running E2E locally #13973

Merged
merged 7 commits into from
Sep 18, 2023
Merged
Show file tree
Hide file tree
Changes from 6 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
3 changes: 1 addition & 2 deletions go/test/endtoend/cluster/cluster_process.go
Original file line number Diff line number Diff line change
Expand Up @@ -334,13 +334,12 @@ func (cluster *LocalProcessCluster) startKeyspace(keyspace Keyspace, shardNames
}
// Create the keyspace if it doesn't already exist.
_ = cluster.VtctlProcess.CreateKeyspace(keyspace.Name, keyspace.SidecarDBName)
var mysqlctlProcessList []*exec.Cmd
for _, shardName := range shardNames {
shard := &Shard{
Name: shardName,
}
log.Infof("Starting shard: %v", shardName)
mysqlctlProcessList = []*exec.Cmd{}
var mysqlctlProcessList []*exec.Cmd
for i := 0; i < totalTabletsRequired; i++ {
// instantiate vttablet object with reserved ports
tabletUID := cluster.GetAndReserveTabletUID()
Expand Down
7 changes: 4 additions & 3 deletions go/test/endtoend/cluster/vttablet_process.go
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ import (
"vitess.io/vitess/go/vt/sqlparser"
)

const vttabletStateTimeout = 30 * time.Second
const vttabletStateTimeout = 60 * time.Second

// VttabletProcess is a generic handle for a running vttablet .
// It can be spawned manually
Expand Down Expand Up @@ -79,7 +79,7 @@ type VttabletProcess struct {
Charset string
ConsolidationsURL string

//Extra Args to be set before starting the vttablet process
// Extra Args to be set before starting the vttablet process
ExtraArgs []string

proc *exec.Cmd
Expand Down Expand Up @@ -150,7 +150,8 @@ func (vttablet *VttabletProcess) Setup() (err error) {
}()

if vttablet.ServingStatus != "" {
if err = vttablet.WaitForTabletStatus(vttablet.ServingStatus); err != nil {
// We wait for any valid status to indicate that the tablet server is running.
if err = vttablet.WaitForTabletStatuses([]string{"SERVING", "NOT_SERVING"}); err != nil {
errFileContent, _ := os.ReadFile(fname)
if errFileContent != nil {
log.Infof("vttablet error:\n%s\n", string(errFileContent))
Expand Down
4 changes: 2 additions & 2 deletions go/test/endtoend/vtgate/queries/misc/misc_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -301,6 +301,6 @@ func TestLeftJoinUsingUnsharded(t *testing.T) {
mcmp, closer := start(t)
defer closer()

utils.Exec(t, mcmp.VtConn, "insert into uks.unsharded(id1) values (1),(2),(3),(4),(5)")
utils.Exec(t, mcmp.VtConn, "select * from uks.unsharded as A left join uks.unsharded as B using(id1)")
utils.Exec(t, mcmp.VtConn, "insert /*vt+ QUERY_TIMEOUT_MS=1000 */ into uks.unsharded(id1) values (1),(2),(3),(4),(5)")
Copy link
Member

Choose a reason for hiding this comment

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

Apparently the test setup defaults this to 100ms and test was failing after that time.

Copy link
Member Author

Choose a reason for hiding this comment

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

Correct, the query timeout is set to 100ms in the TestMain

Copy link
Member

Choose a reason for hiding this comment

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

It's probably the select that is slow. the Insert is expected to be fast on the kind of small test data we use for tests. It's fine to leave the timeout for both queries, it won't hurt anything.

utils.Exec(t, mcmp.VtConn, "select /*vt+ QUERY_TIMEOUT_MS=1000 */ * from uks.unsharded as A left join uks.unsharded as B using(id1)")
}