Skip to content

Commit

Permalink
swarm/storage: fix test timeout with -race by increasing mget timeout
Browse files Browse the repository at this point in the history
  • Loading branch information
frncmx authored and nonsense committed Feb 5, 2019
1 parent f413a3d commit 1c3aa8d
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 5 deletions.
3 changes: 0 additions & 3 deletions swarm/network/simulations/discovery/discovery_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -362,9 +362,6 @@ func discoveryPersistenceSimulation(nodes, conns int, adapter adapters.NodeAdapt
return fmt.Errorf("error getting node string %s", err)
}
log.Info(nodeStr)
for _, a := range addrs {
log.Info(common.Bytes2Hex(a))
}
if !healthy.ConnectNN || healthy.CountKnowNN == 0 {
isHealthy = false
break
Expand Down
5 changes: 3 additions & 2 deletions swarm/storage/common_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -142,10 +142,11 @@ func mget(store ChunkStore, hs []Address, f func(h Address, chunk Chunk) error)
close(errc)
}()
var err error
timeout := 10 * time.Second
select {
case err = <-errc:
case <-time.NewTimer(5 * time.Second).C:
err = fmt.Errorf("timed out after 5 seconds")
case <-time.NewTimer(timeout).C:
err = fmt.Errorf("timed out after %v", timeout)
}
return err
}
Expand Down

0 comments on commit 1c3aa8d

Please sign in to comment.