From e05ee9a8f54904985a40e74601284e968e29bff6 Mon Sep 17 00:00:00 2001 From: ziggie Date: Tue, 13 Jan 2026 12:56:42 +0100 Subject: [PATCH 1/2] linter: update usetesting linter to match old behavior --- .golangci.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.golangci.yml b/.golangci.yml index 3225c5c2b..239ea38e9 100644 --- a/.golangci.yml +++ b/.golangci.yml @@ -187,6 +187,9 @@ linters: rules: json: snake + usetesting: + context-background: true + whitespace: multi-if: true multi-func: true From 35260fc4a7bcc0c25e9a34f2d1aa8e9498bdc889 Mon Sep 17 00:00:00 2001 From: ziggie Date: Tue, 13 Jan 2026 13:01:19 +0100 Subject: [PATCH 2/2] discovery: fix new usetesting linter issues --- discovery/gossiper_test.go | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/discovery/gossiper_test.go b/discovery/gossiper_test.go index b4898c0f8..3d114e35c 100644 --- a/discovery/gossiper_test.go +++ b/discovery/gossiper_test.go @@ -5007,7 +5007,7 @@ func TestRecoverGossipPanic(t *testing.T) { panicked := make(chan struct{}) go func() { defer ctx.gossiper.finalizeGossipProcessing( - context.Background(), "testing", + t.Context(), "testing", nMsg, jobIDRef, ) defer close(panicked) @@ -5070,7 +5070,7 @@ func TestRecoverGossipPanicBlockedErrorChannel(t *testing.T) { panicked := make(chan struct{}) go func() { defer ctx.gossiper.finalizeGossipProcessing( - context.Background(), "testing", nMsg, &jobID, + t.Context(), "testing", nMsg, &jobID, ) defer close(panicked) @@ -5142,7 +5142,7 @@ func TestRecoverGossipPanicSignalsDependents(t *testing.T) { panicked := make(chan struct{}) go func() { defer ctx.gossiper.finalizeGossipProcessing( - context.Background(), "testing", nMsg, &parentJobID, + t.Context(), "testing", nMsg, &parentJobID, ) defer close(panicked) @@ -5212,7 +5212,7 @@ func TestRecoverGossipPanicNilJobID(t *testing.T) { panicked := make(chan struct{}) go func() { defer ctx.gossiper.finalizeGossipProcessing( - context.Background(), "processing", nMsg, nil, + t.Context(), "processing", nMsg, nil, ) defer close(panicked)