swarm/storage: fix test timeout with -race by increasing mget timeout
(cherry picked from commit 1c3aa8d9b12d6104ccddecc1711bc6be2f5b269d)
This commit is contained in:
parent
333b1bfb6c
commit
3c62cc6bba
@ -362,9 +362,6 @@ func discoveryPersistenceSimulation(nodes, conns int, adapter adapters.NodeAdapt
|
|||||||
return fmt.Errorf("error getting node string %s", err)
|
return fmt.Errorf("error getting node string %s", err)
|
||||||
}
|
}
|
||||||
log.Info(nodeStr)
|
log.Info(nodeStr)
|
||||||
for _, a := range addrs {
|
|
||||||
log.Info(common.Bytes2Hex(a))
|
|
||||||
}
|
|
||||||
if !healthy.ConnectNN || healthy.CountKnowNN == 0 {
|
if !healthy.ConnectNN || healthy.CountKnowNN == 0 {
|
||||||
isHealthy = false
|
isHealthy = false
|
||||||
break
|
break
|
||||||
|
@ -142,10 +142,11 @@ func mget(store ChunkStore, hs []Address, f func(h Address, chunk Chunk) error)
|
|||||||
close(errc)
|
close(errc)
|
||||||
}()
|
}()
|
||||||
var err error
|
var err error
|
||||||
|
timeout := 10 * time.Second
|
||||||
select {
|
select {
|
||||||
case err = <-errc:
|
case err = <-errc:
|
||||||
case <-time.NewTimer(5 * time.Second).C:
|
case <-time.NewTimer(timeout).C:
|
||||||
err = fmt.Errorf("timed out after 5 seconds")
|
err = fmt.Errorf("timed out after %v", timeout)
|
||||||
}
|
}
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user