mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-08-20 02:42:27 +00:00
swarm/storage: fix test timeout with -race by increasing mget timeout
`go test -race` might significantly increase test run time (~2-10x).
`-race` caused the following tests to time out both locally and on
the CI. So I doubled the timeout.
--- FAIL: TestDbStoreCorrect_1k (16.88s)
common_test.go:193: testStore failed: timed out after 5 seconds
--- FAIL: TestMockDbStoreCorrect_1k (20.54s)
common_test.go:193: testStore failed: timed out after 5 seconds
Note: The unit for time ('s') will be appended automatically by
`fmt.Errorf()`.
This commit is contained in:
parent
f413a3dbb2
commit
7927fef9a8
1 changed files with 3 additions and 2 deletions
|
|
@ -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
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue