From a5382bb0db5c4945b9ec3d33b4a26bb25377201d Mon Sep 17 00:00:00 2001 From: Harshit Gangal Date: Fri, 15 Nov 2024 17:03:34 +0530 Subject: [PATCH] fix: TestShow expectation by clearning a table created inside a test Signed-off-by: Harshit Gangal --- go/test/endtoend/vtgate/misc_test.go | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/go/test/endtoend/vtgate/misc_test.go b/go/test/endtoend/vtgate/misc_test.go index 5e627048253..48280ea5005 100644 --- a/go/test/endtoend/vtgate/misc_test.go +++ b/go/test/endtoend/vtgate/misc_test.go @@ -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)`) @@ -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)) }