Skip to content

Commit

Permalink
swarm: speed up the TestDialWorkerLoopConcurrentFailureStress test (#…
Browse files Browse the repository at this point in the history
  • Loading branch information
marten-seemann committed May 28, 2022
1 parent 058284b commit 5c297a8
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions p2p/net/swarm/dial_worker_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -289,7 +289,7 @@ func TestDialWorkerLoopConcurrentFailureStress(t *testing.T) {
p2 := tnet.RandPeerNetParamsOrFatal(t)

var addrs []ma.Multiaddr
for i := 0; i < 200; i++ {
for i := 0; i < 16; i++ {
addrs = append(addrs, ma.StringCast(fmt.Sprintf("/ip4/11.0.0.%d/tcp/%d", i%256, 1234+i)))
}
s1.Peerstore().AddAddrs(p2.ID, addrs, peerstore.PermanentAddrTTL)
Expand All @@ -310,8 +310,9 @@ func TestDialWorkerLoopConcurrentFailureStress(t *testing.T) {
reqch <- dialRequest{ctx: context.Background(), resch: reschgo}
select {
case res := <-reschgo:
t.Log("received result")
resch <- res
case <-time.After(5 * time.Minute):
case <-time.After(15 * time.Second):
resch <- dialResponse{err: errTimeout}
}
}()
Expand Down

0 comments on commit 5c297a8

Please sign in to comment.