From d5c9c4adc167cdb05e73f5105702cf340293e61c Mon Sep 17 00:00:00 2001 From: Daenney Date: Thu, 22 May 2025 12:26:11 +0200 Subject: [chore] Upgrade to Go 1.24 (#4187) * Set `go.mod` to 1.24 now that it's been out for 3 months. * Update all the test to use `testing.T.Context()`. Reviewed-on: https://codeberg.org/superseriousbusiness/gotosocial/pulls/4187 Co-authored-by: Daenney Co-committed-by: Daenney --- internal/api/client/filters/v1/filter_test.go | 4 ++-- internal/api/client/filters/v2/filter_test.go | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) (limited to 'internal/api/client/filters') diff --git a/internal/api/client/filters/v1/filter_test.go b/internal/api/client/filters/v1/filter_test.go index df182493e..7beb9313a 100644 --- a/internal/api/client/filters/v1/filter_test.go +++ b/internal/api/client/filters/v1/filter_test.go @@ -115,7 +115,7 @@ func (suite *FiltersTestSuite) TearDownTest() { } func (suite *FiltersTestSuite) openHomeStream(account *gtsmodel.Account) *stream.Stream { - stream, err := suite.processor.Stream().Open(context.Background(), account, stream.TimelineHome) + stream, err := suite.processor.Stream().Open(suite.T().Context(), account, stream.TimelineHome) if err != nil { suite.FailNow(err.Error()) } @@ -129,7 +129,7 @@ func (suite *FiltersTestSuite) checkStreamed( expectEventType string, ) { // Set a 5s timeout on context. - ctx := context.Background() + ctx := suite.T().Context() ctx, cncl := context.WithTimeout(ctx, time.Second*5) defer cncl() diff --git a/internal/api/client/filters/v2/filter_test.go b/internal/api/client/filters/v2/filter_test.go index 038205460..6e9e4ef07 100644 --- a/internal/api/client/filters/v2/filter_test.go +++ b/internal/api/client/filters/v2/filter_test.go @@ -114,7 +114,7 @@ func (suite *FiltersTestSuite) TearDownTest() { } func (suite *FiltersTestSuite) openHomeStream(account *gtsmodel.Account) *stream.Stream { - stream, err := suite.processor.Stream().Open(context.Background(), account, stream.TimelineHome) + stream, err := suite.processor.Stream().Open(suite.T().Context(), account, stream.TimelineHome) if err != nil { suite.FailNow(err.Error()) } @@ -128,7 +128,7 @@ func (suite *FiltersTestSuite) checkStreamed( expectEventType string, ) { // Set a 5s timeout on context. - ctx := context.Background() + ctx := suite.T().Context() ctx, cncl := context.WithTimeout(ctx, time.Second*5) defer cncl() -- cgit v1.2.3