1
0
mirror of https://github.com/ipfs/kubo.git synced 2025-07-01 10:49:24 +08:00

bitswap/test: fix timeout on travis

This commit is contained in:
Juan Batiz-Benet
2015-05-19 16:53:13 -04:00
parent c561c0980b
commit bc6911ef37

View File

@ -8,6 +8,7 @@ import (
detectrace "github.com/ipfs/go-ipfs/Godeps/_workspace/src/github.com/jbenet/go-detect-race" detectrace "github.com/ipfs/go-ipfs/Godeps/_workspace/src/github.com/jbenet/go-detect-race"
context "github.com/ipfs/go-ipfs/Godeps/_workspace/src/golang.org/x/net/context" context "github.com/ipfs/go-ipfs/Godeps/_workspace/src/golang.org/x/net/context"
travis "github.com/ipfs/go-ipfs/util/testutil/ci/travis"
blocks "github.com/ipfs/go-ipfs/blocks" blocks "github.com/ipfs/go-ipfs/blocks"
blocksutil "github.com/ipfs/go-ipfs/blocks/blocksutil" blocksutil "github.com/ipfs/go-ipfs/blocks/blocksutil"
@ -98,6 +99,8 @@ func TestLargeSwarm(t *testing.T) {
// when running with the race detector, 500 instances launches // when running with the race detector, 500 instances launches
// well over 8k goroutines. This hits a race detector limit. // well over 8k goroutines. This hits a race detector limit.
numInstances = 100 numInstances = 100
} else if travis.IsRunning() {
numInstances = 200
} else { } else {
t.Parallel() t.Parallel()
} }
@ -108,7 +111,11 @@ func TestLargeFile(t *testing.T) {
if testing.Short() { if testing.Short() {
t.SkipNow() t.SkipNow()
} }
if !travis.IsRunning() {
t.Parallel() t.Parallel()
}
numInstances := 10 numInstances := 10
numBlocks := 100 numBlocks := 100
PerformDistributionTest(t, numInstances, numBlocks) PerformDistributionTest(t, numInstances, numBlocks)