From 7a525542dbf69191a8af7b236ceb4c3acbc81261 Mon Sep 17 00:00:00 2001 From: Florent Poinsard Date: Wed, 13 Sep 2023 15:50:54 -0400 Subject: [PATCH] Fix TestLeftJoinUsingUnsharded Signed-off-by: Florent Poinsard --- go/test/endtoend/cluster/cluster_process.go | 3 +-- go/test/endtoend/cluster/vttablet_process.go | 9 +++++---- go/test/endtoend/vtgate/queries/misc/misc_test.go | 4 ++-- 3 files changed, 8 insertions(+), 8 deletions(-) diff --git a/go/test/endtoend/cluster/cluster_process.go b/go/test/endtoend/cluster/cluster_process.go index e111e4325f3..6f1b00c53ff 100644 --- a/go/test/endtoend/cluster/cluster_process.go +++ b/go/test/endtoend/cluster/cluster_process.go @@ -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() diff --git a/go/test/endtoend/cluster/vttablet_process.go b/go/test/endtoend/cluster/vttablet_process.go index 9f5e513c7a0..96b972aef2d 100644 --- a/go/test/endtoend/cluster/vttablet_process.go +++ b/go/test/endtoend/cluster/vttablet_process.go @@ -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 @@ -149,8 +149,9 @@ func (vttablet *VttabletProcess) Setup() (err error) { } }() + time.Sleep(10 * time.Second) if vttablet.ServingStatus != "" { - if err = vttablet.WaitForTabletStatus(vttablet.ServingStatus); err != nil { + if err = vttablet.WaitForTabletStatus(vttablet.ServingStatus, "SERVING"); err != nil { errFileContent, _ := os.ReadFile(fname) if errFileContent != nil { log.Infof("vttablet error:\n%s\n", string(errFileContent)) @@ -273,8 +274,8 @@ func (vttablet *VttabletProcess) GetTabletType() string { } // WaitForTabletStatus waits for one of the expected statuses to be reached -func (vttablet *VttabletProcess) WaitForTabletStatus(expectedStatus string) error { - return vttablet.WaitForTabletStatusesForTimeout([]string{expectedStatus}, vttabletStateTimeout) +func (vttablet *VttabletProcess) WaitForTabletStatus(expectedStatus ...string) error { + return vttablet.WaitForTabletStatusesForTimeout(expectedStatus, vttabletStateTimeout) } // WaitForTabletStatuses waits for one of expected statuses is reached diff --git a/go/test/endtoend/vtgate/queries/misc/misc_test.go b/go/test/endtoend/vtgate/queries/misc/misc_test.go index 77cb1784c43..559fcaa9b6e 100644 --- a/go/test/endtoend/vtgate/queries/misc/misc_test.go +++ b/go/test/endtoend/vtgate/queries/misc/misc_test.go @@ -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)") + utils.Exec(t, mcmp.VtConn, "select /*vt+ QUERY_TIMEOUT_MS=1000 */ * from uks.unsharded as A left join uks.unsharded as B using(id1)") }