mirror of
https://github.com/libp2p/go-libp2p.git
synced 2026-04-23 00:27:05 +08:00
refactor: replace context.WithCancel with t.Context
Signed-off-by: cargoedit <cargoedit@outlook.com>
This commit is contained in:
committed by
Marco Munizaga
parent
b3f1e66e26
commit
c8e06bb688
@@ -375,8 +375,7 @@ func TestHostProtoPreference(t *testing.T) {
|
||||
}
|
||||
|
||||
func TestHostProtoMismatch(t *testing.T) {
|
||||
ctx, cancel := context.WithCancel(context.Background())
|
||||
defer cancel()
|
||||
ctx := t.Context()
|
||||
|
||||
h1, h2 := getHostPair(t)
|
||||
defer h1.Close()
|
||||
@@ -469,8 +468,7 @@ func TestHostProtoPreknowledge(t *testing.T) {
|
||||
}
|
||||
|
||||
func TestNewDialOld(t *testing.T) {
|
||||
ctx, cancel := context.WithCancel(context.Background())
|
||||
defer cancel()
|
||||
ctx := t.Context()
|
||||
|
||||
h1, h2 := getHostPair(t)
|
||||
defer h1.Close()
|
||||
@@ -541,8 +539,7 @@ func TestNewStreamResolve(t *testing.T) {
|
||||
}
|
||||
|
||||
func TestProtoDowngrade(t *testing.T) {
|
||||
ctx, cancel := context.WithCancel(context.Background())
|
||||
defer cancel()
|
||||
ctx := t.Context()
|
||||
|
||||
h1, h2 := getHostPair(t)
|
||||
defer h1.Close()
|
||||
@@ -756,8 +753,7 @@ func TestHostAddrChangeDetection(t *testing.T) {
|
||||
}
|
||||
|
||||
func TestNegotiationCancel(t *testing.T) {
|
||||
ctx, cancel := context.WithCancel(context.Background())
|
||||
defer cancel()
|
||||
ctx := t.Context()
|
||||
|
||||
h1, h2 := getHostPair(t)
|
||||
defer h1.Close()
|
||||
|
||||
Reference in New Issue
Block a user