aboutsummaryrefslogtreecommitdiffstats
path: root/swarm/storage/common_test.go
diff options
context:
space:
mode:
authorFerenc Szabo <frncmx@gmail.com>2019-02-09 00:07:11 +0800
committerRafael Matias <rafael@skyle.net>2019-02-19 20:11:51 +0800
commitdcff622d43c6b7e41153d3f082e84a0718cb81c7 (patch)
treeef229ab35c7423d1e7f52fe644b57218abbc8d32 /swarm/storage/common_test.go
parenta3db00f2700a305279efa34420cbb90e7fe279fc (diff)
downloaddexon-dcff622d43c6b7e41153d3f082e84a0718cb81c7.tar
dexon-dcff622d43c6b7e41153d3f082e84a0718cb81c7.tar.gz
dexon-dcff622d43c6b7e41153d3f082e84a0718cb81c7.tar.bz2
dexon-dcff622d43c6b7e41153d3f082e84a0718cb81c7.tar.lz
dexon-dcff622d43c6b7e41153d3f082e84a0718cb81c7.tar.xz
dexon-dcff622d43c6b7e41153d3f082e84a0718cb81c7.tar.zst
dexon-dcff622d43c6b7e41153d3f082e84a0718cb81c7.zip
swarm: CI race detector test adjustments (#19017)
(cherry picked from commit 27e3f968194e2723279b60f71c79d4da9fc7577f)
Diffstat (limited to 'swarm/storage/common_test.go')
-rw-r--r--swarm/storage/common_test.go18
1 files changed, 9 insertions, 9 deletions
diff --git a/swarm/storage/common_test.go b/swarm/storage/common_test.go
index 23d43becc..6955ee827 100644
--- a/swarm/storage/common_test.go
+++ b/swarm/storage/common_test.go
@@ -83,7 +83,7 @@ func newLDBStore(t *testing.T) (*LDBStore, func()) {
return db, cleanup
}
-func mputRandomChunks(store ChunkStore, n int, chunksize int64) ([]Chunk, error) {
+func mputRandomChunks(store ChunkStore, n int) ([]Chunk, error) {
return mput(store, n, GenerateRandomChunk)
}
@@ -91,7 +91,7 @@ func mput(store ChunkStore, n int, f func(i int64) Chunk) (hs []Chunk, err error
// put to localstore and wait for stored channel
// does not check delivery error state
errc := make(chan error)
- ctx, cancel := context.WithTimeout(context.Background(), 30*time.Second)
+ ctx, cancel := context.WithTimeout(context.Background(), 1*time.Minute)
defer cancel()
for i := int64(0); i < int64(n); i++ {
chunk := f(ch.DefaultSize)
@@ -159,8 +159,8 @@ func (r *brokenLimitedReader) Read(buf []byte) (int, error) {
return r.lr.Read(buf)
}
-func testStoreRandom(m ChunkStore, n int, chunksize int64, t *testing.T) {
- chunks, err := mputRandomChunks(m, n, chunksize)
+func testStoreRandom(m ChunkStore, n int, t *testing.T) {
+ chunks, err := mputRandomChunks(m, n)
if err != nil {
t.Fatalf("expected no error, got %v", err)
}
@@ -170,8 +170,8 @@ func testStoreRandom(m ChunkStore, n int, chunksize int64, t *testing.T) {
}
}
-func testStoreCorrect(m ChunkStore, n int, chunksize int64, t *testing.T) {
- chunks, err := mputRandomChunks(m, n, chunksize)
+func testStoreCorrect(m ChunkStore, n int, t *testing.T) {
+ chunks, err := mputRandomChunks(m, n)
if err != nil {
t.Fatalf("expected no error, got %v", err)
}
@@ -195,7 +195,7 @@ func testStoreCorrect(m ChunkStore, n int, chunksize int64, t *testing.T) {
}
}
-func benchmarkStorePut(store ChunkStore, n int, chunksize int64, b *testing.B) {
+func benchmarkStorePut(store ChunkStore, n int, b *testing.B) {
chunks := make([]Chunk, n)
i := 0
f := func(dataSize int64) Chunk {
@@ -222,8 +222,8 @@ func benchmarkStorePut(store ChunkStore, n int, chunksize int64, b *testing.B) {
}
}
-func benchmarkStoreGet(store ChunkStore, n int, chunksize int64, b *testing.B) {
- chunks, err := mputRandomChunks(store, n, chunksize)
+func benchmarkStoreGet(store ChunkStore, n int, b *testing.B) {
+ chunks, err := mputRandomChunks(store, n)
if err != nil {
b.Fatalf("expected no error, got %v", err)
}