From 106749af54cb296828fb7fbbd2f0df2db9b4e6b9 Mon Sep 17 00:00:00 2001 From: Anton Evangelatov Date: Mon, 8 Oct 2018 19:42:43 +0200 Subject: [PATCH] swarm/storage: lower constants for faster tests --- swarm/storage/chunker_test.go | 3 ++- swarm/storage/filestore_test.go | 2 +- swarm/storage/ldbstore_test.go | 16 ++++++++-------- swarm/storage/memstore_test.go | 8 ++------ 4 files changed, 13 insertions(+), 16 deletions(-) diff --git a/swarm/storage/chunker_test.go b/swarm/storage/chunker_test.go index db719ca047..6172d8a092 100644 --- a/swarm/storage/chunker_test.go +++ b/swarm/storage/chunker_test.go @@ -232,7 +232,8 @@ func TestDataAppend(t *testing.T) { func TestRandomData(t *testing.T) { // This test can validate files up to a relatively short length, as tree chunker slows down drastically. // Validation of longer files is done by TestLocalStoreAndRetrieve in swarm package. - sizes := []int{1, 60, 83, 179, 253, 1024, 4095, 4096, 4097, 8191, 8192, 8193, 12287, 12288, 12289, 524288, 524288 + 1, 524288 + 4097, 7 * 524288, 7*524288 + 1, 7*524288 + 4097} + //sizes := []int{1, 60, 83, 179, 253, 1024, 4095, 4096, 4097, 8191, 8192, 8193, 12287, 12288, 12289, 524288, 524288 + 1, 524288 + 4097, 7 * 524288, 7*524288 + 1, 7*524288 + 4097} + sizes := []int{1, 60, 83, 179, 253, 1024, 4095, 4097, 8191, 8192, 12288, 12289, 524288} tester := &chunkerTester{t: t} for _, s := range sizes { diff --git a/swarm/storage/filestore_test.go b/swarm/storage/filestore_test.go index d79efb530d..9fe58f60c8 100644 --- a/swarm/storage/filestore_test.go +++ b/swarm/storage/filestore_test.go @@ -25,7 +25,7 @@ import ( "testing" ) -const testDataSize = 0x1000000 +const testDataSize = 0x0001000 func TestFileStorerandom(t *testing.T) { testFileStoreRandom(false, t) diff --git a/swarm/storage/ldbstore_test.go b/swarm/storage/ldbstore_test.go index 75b5d6aa95..14a42b5e3d 100644 --- a/swarm/storage/ldbstore_test.go +++ b/swarm/storage/ldbstore_test.go @@ -111,12 +111,12 @@ func TestDbStoreCorrect_1(t *testing.T) { testDbStoreCorrect(1, 4096, false, t) } -func TestDbStoreRandom_5k(t *testing.T) { - testDbStoreRandom(5000, 0, false, t) +func TestDbStoreRandom_1k(t *testing.T) { + testDbStoreRandom(1000, 0, false, t) } -func TestDbStoreCorrect_5k(t *testing.T) { - testDbStoreCorrect(5000, 4096, false, t) +func TestDbStoreCorrect_1k(t *testing.T) { + testDbStoreCorrect(1000, 4096, false, t) } func TestMockDbStoreRandom_1(t *testing.T) { @@ -127,12 +127,12 @@ func TestMockDbStoreCorrect_1(t *testing.T) { testDbStoreCorrect(1, 4096, true, t) } -func TestMockDbStoreRandom_5k(t *testing.T) { - testDbStoreRandom(5000, 0, true, t) +func TestMockDbStoreRandom_1k(t *testing.T) { + testDbStoreRandom(1000, 0, true, t) } -func TestMockDbStoreCorrect_5k(t *testing.T) { - testDbStoreCorrect(5000, 4096, true, t) +func TestMockDbStoreCorrect_1k(t *testing.T) { + testDbStoreCorrect(1000, 4096, true, t) } func testDbStoreNotFound(t *testing.T, mock bool) { diff --git a/swarm/storage/memstore_test.go b/swarm/storage/memstore_test.go index 6b370d2b41..6850d2d69a 100644 --- a/swarm/storage/memstore_test.go +++ b/swarm/storage/memstore_test.go @@ -111,7 +111,7 @@ func TestMemStoreAndLDBStore(t *testing.T) { chunkSize: 4096, }, { - n: 201, + n: 101, chunkSize: 4096, }, { @@ -119,11 +119,7 @@ func TestMemStoreAndLDBStore(t *testing.T) { chunkSize: 4096, }, { - n: 3100, - chunkSize: 4096, - }, - { - n: 100, + n: 1100, chunkSize: 4096, }, }