multi: context.Background() -> t.Context()
Use the new feature of Go 1.24, fix linter warnings. This change was produced by: - running golangci-lint run --fix - sed 's/context.Background/t.Context/' -i `git grep -l context.Background | grep test.go` - manually fixing broken tests - itest, lntest: use ht.Context() where ht or hn is available - in HarnessNode.Stop() we keep using context.Background(), because it is called from a cleanup handler in which t.Context() is canceled already.
This commit is contained in:
71 files changed
+361
-393
No files matched your search
@@ -20,7 +20,7 @@ var (
|
||||
// deduplicates the results of a set of AddrSource implementations.
|
||||
func TestMultiAddrSource(t *testing.T) {
|
||||
t.Parallel()
|
||||
ctx := context.Background()
|
||||
ctx := t.Context()
|
||||
|
||||
var pk1 = newTestPubKey(t)
|
||||
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
package channeldb
|
||||
|
||||
import (
|
||||
"context"
|
||||
"image/color"
|
||||
"math"
|
||||
"math/rand"
|
||||
@@ -181,7 +180,7 @@ func TestFetchClosedChannelForID(t *testing.T) {
|
||||
// channel db and graph db.
|
||||
func TestMultiSourceAddrsForNode(t *testing.T) {
|
||||
t.Parallel()
|
||||
ctx := context.Background()
|
||||
ctx := t.Context()
|
||||
|
||||
fullDB, err := MakeTestDB(t)
|
||||
require.NoError(t, err, "unable to make test database")
|
||||
|
||||
Reference in new issue
Block a user