From e6726681a9b5d4b730e13eb9a7200a9fcd01394b Mon Sep 17 00:00:00 2001 From: Kat Yang <69819079+yangkb09@users.noreply.github.com> Date: Fri, 25 Mar 2022 13:23:21 -0400 Subject: [PATCH] Chore: Remove x from annotation test (#46935) --- pkg/services/sqlstore/annotation_test.go | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/pkg/services/sqlstore/annotation_test.go b/pkg/services/sqlstore/annotation_test.go index 8721dd3045c..4c508b7f0fc 100644 --- a/pkg/services/sqlstore/annotation_test.go +++ b/pkg/services/sqlstore/annotation_test.go @@ -21,9 +21,14 @@ func TestAnnotations(t *testing.T) { t.Run("Testing annotation create, read, update and delete", func(t *testing.T) { t.Cleanup(func() { - _, err := x.Exec("DELETE FROM annotation WHERE 1=1") - assert.NoError(t, err) - _, err = x.Exec("DELETE FROM annotation_tag WHERE 1=1") + err := repo.sql.WithDbSession(context.Background(), func(dbSession *DBSession) error { + _, err := dbSession.Exec("DELETE FROM annotation WHERE 1=1") + if err != nil { + return err + } + _, err = dbSession.Exec("DELETE FROM annotation_tag WHERE 1=1") + return err + }) assert.NoError(t, err) })