Skip to content
This repository was archived by the owner on May 26, 2022. It is now read-only.

Commit 0531f9f

Browse files
stop using transport.DialTimeout in tests (#307)
1 parent c8e8b2b commit 0531f9f

File tree

1 file changed

+0
-9
lines changed

1 file changed

+0
-9
lines changed

limiter_test.go

-9
Original file line numberDiff line numberDiff line change
@@ -18,12 +18,6 @@ import (
1818
mafmt "github.com/multiformats/go-multiaddr-fmt"
1919
)
2020

21-
func setDialTimeout(t time.Duration) (reset func()) {
22-
orig := transport.DialTimeout
23-
transport.DialTimeout = t
24-
return func() { transport.DialTimeout = orig }
25-
}
26-
2721
func addrWithPort(p int) ma.Multiaddr {
2822
return ma.StringCast(fmt.Sprintf("/ip4/127.0.0.1/tcp/%d", p))
2923
}
@@ -341,9 +335,6 @@ func TestStressLimiter(t *testing.T) {
341335
}
342336

343337
func TestFDLimitUnderflow(t *testing.T) {
344-
reset := setDialTimeout(250 * time.Millisecond)
345-
defer reset()
346-
347338
df := func(ctx context.Context, p peer.ID, addr ma.Multiaddr) (transport.CapableConn, error) {
348339
select {
349340
case <-ctx.Done():

0 commit comments

Comments
 (0)