diff options
author | Jimmy Hu <jimmy.hu@dexon.org> | 2018-10-25 17:38:47 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-10-25 17:38:47 +0800 |
commit | 1e84ff2da76534b7b2412d2f4e862090dc31192c (patch) | |
tree | 02661cf8351be4944386352831ad4d8924ee9655 | |
parent | 04eeac10e6c690e62ae57ef0e2bdf4618b8782d1 (diff) | |
download | dexon-consensus-1e84ff2da76534b7b2412d2f4e862090dc31192c.tar dexon-consensus-1e84ff2da76534b7b2412d2f4e862090dc31192c.tar.gz dexon-consensus-1e84ff2da76534b7b2412d2f4e862090dc31192c.tar.bz2 dexon-consensus-1e84ff2da76534b7b2412d2f4e862090dc31192c.tar.lz dexon-consensus-1e84ff2da76534b7b2412d2f4e862090dc31192c.tar.xz dexon-consensus-1e84ff2da76534b7b2412d2f4e862090dc31192c.tar.zst dexon-consensus-1e84ff2da76534b7b2412d2f4e862090dc31192c.zip |
misc: Add longer timeout for test in master (#258)
-rw-r--r-- | GNUmakefile | 2 | ||||
-rw-r--r-- | core/lattice_test.go | 20 |
2 files changed, 14 insertions, 8 deletions
diff --git a/GNUmakefile b/GNUmakefile index 819519e..92c8f57 100644 --- a/GNUmakefile +++ b/GNUmakefile @@ -93,7 +93,7 @@ test-short: test: @for pkg in `go list ./... | grep -v 'vendor'`; do \ - if ! go test -race $$pkg; then \ + if ! go test -timeout 15m -race $$pkg; then \ echo 'Some test failed, abort'; \ exit 1; \ fi; \ diff --git a/core/lattice_test.go b/core/lattice_test.go index ff479bc..e14321d 100644 --- a/core/lattice_test.go +++ b/core/lattice_test.go @@ -216,18 +216,24 @@ func (s *LatticeTestSuite) TestSync() { // and process it. Those generated blocks and kept into a buffer, and // process by other Lattice instances with random order. var ( + chainNum = uint32(19) + otherLatticeNum = 50 + ) + if testing.Short() { + chainNum = 13 + otherLatticeNum = 20 + } + var ( blockNum = 500 // The first `desyncNum` blocks revealed are considered "desynced" and will // not be delivered to lattice. After `syncNum` blocks have revealed, the // system is considered "synced" and start feeding blocks that are desynced // to processFinalizedBlock. - desyncNum = 50 - syncNum = 150 - chainNum = uint32(19) - otherLatticeNum = 50 - req = s.Require() - err error - cfg = types.Config{ + desyncNum = 50 + syncNum = 150 + req = s.Require() + err error + cfg = types.Config{ NumChains: chainNum, NotarySetSize: chainNum, PhiRatio: float32(2) / float32(3), |