forked from cerc-io/plugeth
swarm, swarm/storage: lower constants for faster tests (#17876)
* swarm/storage: lower constants for faster tests * swarm: reduce test size for TestLocalStoreAndRetrieve * swarm: reduce nodes for dec_inc_node_count
This commit is contained in:
parent
d5c7a6056a
commit
0fe9a372b3
@ -150,14 +150,14 @@ func TestSwarmNetwork(t *testing.T) {
|
|||||||
{
|
{
|
||||||
name: "dec_inc_node_count",
|
name: "dec_inc_node_count",
|
||||||
steps: []testSwarmNetworkStep{
|
steps: []testSwarmNetworkStep{
|
||||||
{
|
|
||||||
nodeCount: 5,
|
|
||||||
},
|
|
||||||
{
|
{
|
||||||
nodeCount: 3,
|
nodeCount: 3,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
nodeCount: 10,
|
nodeCount: 1,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
nodeCount: 5,
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
options: &testSwarmNetworkOptions{
|
options: &testSwarmNetworkOptions{
|
||||||
|
@ -232,7 +232,8 @@ func TestDataAppend(t *testing.T) {
|
|||||||
func TestRandomData(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.
|
// 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.
|
// 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}
|
tester := &chunkerTester{t: t}
|
||||||
|
|
||||||
for _, s := range sizes {
|
for _, s := range sizes {
|
||||||
|
@ -25,7 +25,7 @@ import (
|
|||||||
"testing"
|
"testing"
|
||||||
)
|
)
|
||||||
|
|
||||||
const testDataSize = 0x1000000
|
const testDataSize = 0x0001000
|
||||||
|
|
||||||
func TestFileStorerandom(t *testing.T) {
|
func TestFileStorerandom(t *testing.T) {
|
||||||
testFileStoreRandom(false, t)
|
testFileStoreRandom(false, t)
|
||||||
|
@ -111,12 +111,12 @@ func TestDbStoreCorrect_1(t *testing.T) {
|
|||||||
testDbStoreCorrect(1, 4096, false, t)
|
testDbStoreCorrect(1, 4096, false, t)
|
||||||
}
|
}
|
||||||
|
|
||||||
func TestDbStoreRandom_5k(t *testing.T) {
|
func TestDbStoreRandom_1k(t *testing.T) {
|
||||||
testDbStoreRandom(5000, 0, false, t)
|
testDbStoreRandom(1000, 0, false, t)
|
||||||
}
|
}
|
||||||
|
|
||||||
func TestDbStoreCorrect_5k(t *testing.T) {
|
func TestDbStoreCorrect_1k(t *testing.T) {
|
||||||
testDbStoreCorrect(5000, 4096, false, t)
|
testDbStoreCorrect(1000, 4096, false, t)
|
||||||
}
|
}
|
||||||
|
|
||||||
func TestMockDbStoreRandom_1(t *testing.T) {
|
func TestMockDbStoreRandom_1(t *testing.T) {
|
||||||
@ -127,12 +127,12 @@ func TestMockDbStoreCorrect_1(t *testing.T) {
|
|||||||
testDbStoreCorrect(1, 4096, true, t)
|
testDbStoreCorrect(1, 4096, true, t)
|
||||||
}
|
}
|
||||||
|
|
||||||
func TestMockDbStoreRandom_5k(t *testing.T) {
|
func TestMockDbStoreRandom_1k(t *testing.T) {
|
||||||
testDbStoreRandom(5000, 0, true, t)
|
testDbStoreRandom(1000, 0, true, t)
|
||||||
}
|
}
|
||||||
|
|
||||||
func TestMockDbStoreCorrect_5k(t *testing.T) {
|
func TestMockDbStoreCorrect_1k(t *testing.T) {
|
||||||
testDbStoreCorrect(5000, 4096, true, t)
|
testDbStoreCorrect(1000, 4096, true, t)
|
||||||
}
|
}
|
||||||
|
|
||||||
func testDbStoreNotFound(t *testing.T, mock bool) {
|
func testDbStoreNotFound(t *testing.T, mock bool) {
|
||||||
|
@ -111,7 +111,7 @@ func TestMemStoreAndLDBStore(t *testing.T) {
|
|||||||
chunkSize: 4096,
|
chunkSize: 4096,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
n: 201,
|
n: 101,
|
||||||
chunkSize: 4096,
|
chunkSize: 4096,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
@ -119,11 +119,7 @@ func TestMemStoreAndLDBStore(t *testing.T) {
|
|||||||
chunkSize: 4096,
|
chunkSize: 4096,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
n: 3100,
|
n: 1100,
|
||||||
chunkSize: 4096,
|
|
||||||
},
|
|
||||||
{
|
|
||||||
n: 100,
|
|
||||||
chunkSize: 4096,
|
chunkSize: 4096,
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
@ -316,11 +316,11 @@ func TestLocalStoreAndRetrieve(t *testing.T) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// by default, test only the lonely chunk cases
|
// by default, test only the lonely chunk cases
|
||||||
sizes := []int{1, 60, 4097, 524288 + 1, 7*524288 + 1, 128*524288 + 1}
|
sizes := []int{1, 60, 4097, 524288 + 1, 7*524288 + 1}
|
||||||
|
|
||||||
if *longrunning {
|
if *longrunning {
|
||||||
// test broader set of cases if -longruning flag is set
|
// test broader set of cases if -longruning flag is set
|
||||||
sizes = append(sizes, 83, 179, 253, 1024, 4095, 4096, 8191, 8192, 8193, 12287, 12288, 12289, 123456, 2345678, 67298391, 524288, 524288+4096, 524288+4097, 7*524288, 7*524288+4096, 7*524288+4097, 128*524288, 128*524288+4096, 128*524288+4097, 816778334)
|
sizes = append(sizes, 83, 179, 253, 1024, 4095, 4096, 8191, 8192, 8193, 12287, 12288, 12289, 123456, 2345678, 67298391, 524288, 524288+4096, 524288+4097, 7*524288, 7*524288+4096, 7*524288+4097, 128*524288+1, 128*524288, 128*524288+4096, 128*524288+4097, 816778334)
|
||||||
}
|
}
|
||||||
for _, n := range sizes {
|
for _, n := range sizes {
|
||||||
testLocalStoreAndRetrieve(t, swarm, n, true)
|
testLocalStoreAndRetrieve(t, swarm, n, true)
|
||||||
|
Loading…
Reference in New Issue
Block a user