Skip to content

Commit

Permalink
Apply dial timeout globally (#54)
Browse files Browse the repository at this point in the history
  • Loading branch information
dennis-tra committed Oct 6, 2023
1 parent a07f08d commit 43c7867
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions topology_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -123,8 +123,10 @@ func (t *Topology) hostOpts() []libp2p.Option {
// as the tests time out. By setting the timeout to a much lower value, we
// work around the timeout issue. Try to remove the following swarm options
// after https://github.com/libp2p/go-libp2p/issues/2589 was resolved.
localDialTimeout := 100 * time.Millisecond
swarmOpts := libp2p.SwarmOpts(swarm.WithDialTimeoutLocal(localDialTimeout))
// Also, the below should be changed to [swarm.WithDialTimeoutLocal]. Change
// that after https://github.com/libp2p/go-libp2p/pull/2595 is resolved.
dialTimeout := 100 * time.Millisecond
swarmOpts := libp2p.SwarmOpts(swarm.WithDialTimeout(dialTimeout))

return []libp2p.Option{swarmOpts}
}
Expand Down

0 comments on commit 43c7867

Please sign in to comment.