Skip to content

Commit

Permalink
add goleak to packages using the host struct
Browse files Browse the repository at this point in the history
  • Loading branch information
ChrisSchinnerl committed Feb 13, 2024
1 parent 17d282e commit f77a441
Show file tree
Hide file tree
Showing 5 changed files with 17 additions and 0 deletions.
1 change: 1 addition & 0 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ require (
go.sia.tech/renterd v0.6.0
go.sia.tech/siad v1.5.10-0.20230228235644-3059c0b930ca
go.sia.tech/web/hostd v0.37.0
go.uber.org/goleak v1.2.0
go.uber.org/zap v1.26.0
golang.org/x/sys v0.16.0
golang.org/x/term v0.16.0
Expand Down
1 change: 1 addition & 0 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -277,6 +277,7 @@ golang.org/x/crypto v0.18.0/go.mod h1:R0j02AL6hcrfOiy9T4ZYp/rcWeMxM3L6QYxlOuEG1m
golang.org/x/lint v0.0.0-20181026193005-c67002cb31c3/go.mod h1:UVdnD1Gm6xHRNCYTkRU2/jEulfH38KcIWyp/GAMgvoE=
golang.org/x/lint v0.0.0-20190313153728-d0100b6bd8b3/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc=
golang.org/x/lint v0.0.0-20200302205851-738671d3881b/go.mod h1:3xt1FjdF8hUf6vQPIChWIBhFzV8gjjsPE/fR3IyQdNY=
golang.org/x/lint v0.0.0-20210508222113-6edffad5e616 h1:VLliZ0d+/avPrXXH+OakdXhpJuEoBZuwh1m2j7U6Iug=
golang.org/x/lint v0.0.0-20210508222113-6edffad5e616/go.mod h1:3xt1FjdF8hUf6vQPIChWIBhFzV8gjjsPE/fR3IyQdNY=
golang.org/x/mod v0.1.1-0.20191105210325-c90efee705ee/go.mod h1:QqPTAvyqsEbceGzBzNggFXnrqF1CaUcvgkdR5Ot7KZg=
golang.org/x/mod v0.12.0 h1:rmsUpXtvNzj340zd98LZ4KntptpfRHwpFOHG188oHXc=
Expand Down
5 changes: 5 additions & 0 deletions host/contracts/revenue_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,15 @@ import (
"go.sia.tech/hostd/internal/test"
rhp3 "go.sia.tech/hostd/internal/test/rhp/v3"
"go.sia.tech/hostd/persist/sqlite"
"go.uber.org/goleak"
"go.uber.org/zap/zaptest"
"lukechampine.com/frand"
)

func TestMain(m *testing.M) {
goleak.VerifyTestMain(m)
}

func checkRevenueConsistency(s *sqlite.Store, potential, earned metrics.Revenue) error {
time.Sleep(time.Second) // commit time

Expand Down
5 changes: 5 additions & 0 deletions rhp/v2/rpc_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,15 @@ import (
"go.sia.tech/core/types"
"go.sia.tech/hostd/internal/test"
"go.sia.tech/renterd/wallet"
"go.uber.org/goleak"
"go.uber.org/zap/zaptest"
"lukechampine.com/frand"
)

func TestMain(m *testing.M) {
goleak.VerifyTestMain(m)
}

func TestSettings(t *testing.T) {
log := zaptest.NewLogger(t)
renter, host, err := test.NewTestingPair(t.TempDir(), log)
Expand Down
5 changes: 5 additions & 0 deletions rhp/v3/websocket_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,15 @@ import (

rhp3 "go.sia.tech/core/rhp/v3"
"go.sia.tech/hostd/internal/test"
"go.uber.org/goleak"
"go.uber.org/zap/zaptest"
"nhooyr.io/websocket"
)

func TestMain(m *testing.M) {
goleak.VerifyTestMain(m)
}

func TestWebSockets(t *testing.T) {
log := zaptest.NewLogger(t)
renter, host, err := test.NewTestingPair(t.TempDir(), log)
Expand Down

0 comments on commit f77a441

Please sign in to comment.