Skip to content

Commit

Permalink
stop using transport.DialTimeout in tests (#307)
Browse files Browse the repository at this point in the history
  • Loading branch information
marten-seemann authored Dec 30, 2021
1 parent 5674317 commit c35965b
Showing 1 changed file with 0 additions and 9 deletions.
9 changes: 0 additions & 9 deletions p2p/net/swarm/limiter_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,12 +18,6 @@ import (
mafmt "github.com/multiformats/go-multiaddr-fmt"
)

func setDialTimeout(t time.Duration) (reset func()) {
orig := transport.DialTimeout
transport.DialTimeout = t
return func() { transport.DialTimeout = orig }
}

func addrWithPort(p int) ma.Multiaddr {
return ma.StringCast(fmt.Sprintf("/ip4/127.0.0.1/tcp/%d", p))
}
Expand Down Expand Up @@ -341,9 +335,6 @@ func TestStressLimiter(t *testing.T) {
}

func TestFDLimitUnderflow(t *testing.T) {
reset := setDialTimeout(250 * time.Millisecond)
defer reset()

df := func(ctx context.Context, p peer.ID, addr ma.Multiaddr) (transport.CapableConn, error) {
select {
case <-ctx.Done():
Expand Down

0 comments on commit c35965b

Please sign in to comment.