diff options
author | Jimmy Hu <jimmy.hu@dexon.org> | 2018-10-04 10:10:15 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-10-04 10:10:15 +0800 |
commit | 9132f28a52b372efe0b13678db41d125ee37c358 (patch) | |
tree | f5401256e69114848c877cc700176072d3337868 | |
parent | 64efb7a31383c912b3980b02c7e6dea34247aaf7 (diff) | |
download | dexon-consensus-9132f28a52b372efe0b13678db41d125ee37c358.tar dexon-consensus-9132f28a52b372efe0b13678db41d125ee37c358.tar.gz dexon-consensus-9132f28a52b372efe0b13678db41d125ee37c358.tar.bz2 dexon-consensus-9132f28a52b372efe0b13678db41d125ee37c358.tar.lz dexon-consensus-9132f28a52b372efe0b13678db41d125ee37c358.tar.xz dexon-consensus-9132f28a52b372efe0b13678db41d125ee37c358.tar.zst dexon-consensus-9132f28a52b372efe0b13678db41d125ee37c358.zip |
test: Short test applied to some long running tests (#168)
-rw-r--r-- | core/lattice_test.go | 5 | ||||
-rw-r--r-- | core/total-ordering_test.go | 8 | ||||
-rw-r--r-- | integration_test/non-byzantine_test.go | 6 |
3 files changed, 16 insertions, 3 deletions
diff --git a/core/lattice_test.go b/core/lattice_test.go index 1df4f4e..1be9a0e 100644 --- a/core/lattice_test.go +++ b/core/lattice_test.go @@ -519,6 +519,11 @@ func (s *LatticeTestSuite) TestRandomlyGeneratedBlocks() { datum []*latticeData ) + if testing.Short() { + chainNum = 7 + repeat = 3 + } + // Prepare a randomly generated blocks. db, err := blockdb.NewMemBackedBlockDB() req.Nil(err) diff --git a/core/total-ordering_test.go b/core/total-ordering_test.go index 347ef22..fcadc89 100644 --- a/core/total-ordering_test.go +++ b/core/total-ordering_test.go @@ -945,11 +945,15 @@ func (s *TotalOrderingTestSuite) baseTestRandomlyGeneratedBlocks( func (s *TotalOrderingTestSuite) TestRandomlyGeneratedBlocks() { var ( round uint64 - chainNum = uint32(13) + chainNum = uint32(23) blockNum = 50 phi uint64 = 10 - repeat = 8 + repeat = 15 ) + if testing.Short() { + chainNum = 7 + repeat = 3 + } ackingCountGenerators := []func() int{ nil, // Acking frequency with normal distribution. diff --git a/integration_test/non-byzantine_test.go b/integration_test/non-byzantine_test.go index 34c6be1..df08b97 100644 --- a/integration_test/non-byzantine_test.go +++ b/integration_test/non-byzantine_test.go @@ -32,6 +32,10 @@ type NonByzantineTestSuite struct { } func (s *NonByzantineTestSuite) TestNonByzantine() { + numNodes := 25 + if testing.Short() { + numNodes = 7 + } var ( networkLatency = &test.NormalLatencyModel{ Sigma: 20, @@ -47,7 +51,7 @@ func (s *NonByzantineTestSuite) TestNonByzantine() { ) apps, dbs, nodes, err := PrepareNodes( - 25, networkLatency, proposingLatency) + numNodes, networkLatency, proposingLatency) req.Nil(err) now := time.Now().UTC() sch := test.NewScheduler(test.NewStopByConfirmedBlocks(50, apps, dbs)) |