Skip to content

Commit

Permalink
Fix TestLeftJoinUsingUnsharded
Browse files Browse the repository at this point in the history
Signed-off-by: Florent Poinsard <[email protected]>
  • Loading branch information
frouioui committed Sep 13, 2023
1 parent 45a94de commit 7a52554
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 8 deletions.
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
9 changes: 5 additions & 4 deletions go/test/endtoend/cluster/vttablet_process.go
Original file line number Diff line number Diff line change
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 @@ -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))
Expand Down Expand Up @@ -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
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)")
utils.Exec(t, mcmp.VtConn, "select /*vt+ QUERY_TIMEOUT_MS=1000 */ * from uks.unsharded as A left join uks.unsharded as B using(id1)")
}

0 comments on commit 7a52554

Please sign in to comment.