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
@@ -173,7 +173,7 @@ func TestChainWatcherRemoteUnilateralClosePendingCommit(t *testing.T) {
|
||||
|
||||
// With the HTLC added, we'll now manually initiate a state transition
|
||||
// from Alice to Bob.
|
||||
testQuit, testQuitFunc := context.WithCancel(context.Background())
|
||||
testQuit, testQuitFunc := context.WithCancel(t.Context())
|
||||
t.Cleanup(testQuitFunc)
|
||||
_, err = aliceChannel.SignNextCommitment(testQuit)
|
||||
require.NoError(t, err)
|
||||
|
||||
Reference in new issue
Block a user