From dec47e5e7b64db947f497d5612d3f09acf74a61b Mon Sep 17 00:00:00 2001 From: Woosang Son Date: Wed, 10 Jun 2020 14:09:59 +0900 Subject: [PATCH] fix: restore test code --- blockchain/v1/peer_test.go | 4 ++-- consensus/common_test.go | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/blockchain/v1/peer_test.go b/blockchain/v1/peer_test.go index 7aa17ef15..0e7a73473 100644 --- a/blockchain/v1/peer_test.go +++ b/blockchain/v1/peer_test.go @@ -32,7 +32,7 @@ func TestPeerResetBlockResponseTimer(t *testing.T) { lastErr error // last generated error peerTestMtx sync.Mutex // modifications of ^^ variables are also done from timer handler goroutine ) - params := &BpPeerParams{timeout: 5 * time.Millisecond} + params := &BpPeerParams{timeout: 2 * time.Millisecond} peer := NewBpPeer( p2p.ID(tmrand.Str(12)), 0, 10, @@ -60,7 +60,7 @@ func TestPeerResetBlockResponseTimer(t *testing.T) { assert.NotNil(t, peer.blockResponseTimer) // let the timer expire and ... - time.Sleep(7 * time.Millisecond) + time.Sleep(3 * time.Millisecond) // ... check timer is not running checkByStoppingPeerTimer(t, peer, false) diff --git a/consensus/common_test.go b/consensus/common_test.go index 13a3de4c6..ce332aba9 100644 --- a/consensus/common_test.go +++ b/consensus/common_test.go @@ -52,7 +52,7 @@ type cleanupFunc func() // genesis, chain_id, priv_val var config *cfg.Config // NOTE: must be reset for each _test.go file var consensusReplayConfig *cfg.Config -var ensureTimeout = time.Millisecond * 200 +var ensureTimeout = time.Millisecond * 100 func ensureDir(dir string, mode os.FileMode) { if err := tmos.EnsureDir(dir, mode); err != nil {