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

stop using transport.DialTimeout in tests #307

Merged
merged 1 commit into from
Dec 30, 2021
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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