Skip to content

Commit

Permalink
fix: TestShow expectation by clearning a table created inside a test
Browse files Browse the repository at this point in the history
Signed-off-by: Harshit Gangal <[email protected]>
  • Loading branch information
harshit-gangal committed Nov 15, 2024
1 parent 050a239 commit a5382bb
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions go/test/endtoend/vtgate/misc_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -804,6 +804,8 @@ func TestDDLTargeted(t *testing.T) {
require.NoError(t, err)
defer conn.Close()

defer utils.Exec(t, conn, "drop table if exists ddl_targeted")

utils.Exec(t, conn, "use `ks/-80`")
utils.Exec(t, conn, `begin`)
utils.Exec(t, conn, `create table ddl_targeted (id bigint primary key)`)
Expand Down Expand Up @@ -863,10 +865,10 @@ func TestShow(t *testing.T) {

qr := utils.Exec(t, conn, "show tables")
assert.Equal(t, 1, len(qr.Fields))
assert.Equal(t, 22, len(qr.Rows))
assert.Equal(t, 21, len(qr.Rows))

utils.Exec(t, conn, "begin")
qr = utils.Exec(t, conn, "show tables")
assert.Equal(t, 1, len(qr.Fields))
assert.Equal(t, 22, len(qr.Rows))
assert.Equal(t, 21, len(qr.Rows))
}

0 comments on commit a5382bb

Please sign in to comment.