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

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 c8e8b2b commit 0531f9f
Showing 1 changed file with 0 additions and 9 deletions.
9 changes: 0 additions & 9 deletions 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 0531f9f

Please sign in to comment.