From bd2c20645571ca7b3ca7115cbe242b89ccc7d79a Mon Sep 17 00:00:00 2001 From: Fedor Korotkiy Date: Sat, 8 Apr 2023 13:08:35 +0400 Subject: [PATCH] Check for goroutine leaks in SQL tasks --- dao/dao_test.go | 2 ++ ledger/ledger_test.go | 3 +++ shopfront/shopfront_test.go | 3 +++ 3 files changed, 8 insertions(+) diff --git a/dao/dao_test.go b/dao/dao_test.go index 1e5b841..6b31a3f 100644 --- a/dao/dao_test.go +++ b/dao/dao_test.go @@ -7,11 +7,13 @@ import ( "testing" "github.com/stretchr/testify/require" + "go.uber.org/goleak" "gitlab.com/slon/shad-go/pgfixture" ) func TestDao(t *testing.T) { + goleak.VerifyNone(t) dsn := pgfixture.Start(t) ctx := context.Background() diff --git a/ledger/ledger_test.go b/ledger/ledger_test.go index 06f19c6..67d7e08 100644 --- a/ledger/ledger_test.go +++ b/ledger/ledger_test.go @@ -9,12 +9,15 @@ import ( "time" "github.com/stretchr/testify/require" + "go.uber.org/goleak" "gitlab.com/slon/shad-go/ledger" "gitlab.com/slon/shad-go/pgfixture" ) func TestLedger(t *testing.T) { + goleak.VerifyNone(t) + dsn := pgfixture.Start(t) ctx := context.Background() diff --git a/shopfront/shopfront_test.go b/shopfront/shopfront_test.go index 45c39bd..2d42ab1 100644 --- a/shopfront/shopfront_test.go +++ b/shopfront/shopfront_test.go @@ -6,11 +6,14 @@ import ( "github.com/go-redis/redis/v8" "github.com/stretchr/testify/require" + "go.uber.org/goleak" "gitlab.com/slon/shad-go/shopfront" ) func TestShopfront(t *testing.T) { + goleak.VerifyNone(t) + rdb := redis.NewClient(&redis.Options{ Addr: StartRedis(t), })