From 5819de48d26c0812b18e97c52582985cfff9fe5d Mon Sep 17 00:00:00 2001 From: yahtoo Date: Fri, 26 Jul 2019 17:01:29 +0800 Subject: [PATCH] Add network delay simulation in test (#359) --- netsync/chainmgr/tool_test.go | 2 ++ 1 file changed, 2 insertions(+) diff --git a/netsync/chainmgr/tool_test.go b/netsync/chainmgr/tool_test.go index b9d661fd..63b6a2f5 100644 --- a/netsync/chainmgr/tool_test.go +++ b/netsync/chainmgr/tool_test.go @@ -4,6 +4,7 @@ import ( "errors" "math/rand" "net" + "time" "github.com/tendermint/go-wire" "github.com/tendermint/tmlibs/flowrate" @@ -84,6 +85,7 @@ func (p *P2PPeer) setAsync(b bool) { func (p *P2PPeer) postMan() { for msgBytes := range p.msgCh { msgType, msg, _ := decodeMessage(msgBytes) + time.Sleep(10 * time.Millisecond) p.remoteNode.processMsg(p.srcPeer, msgType, msg) } } -- 2.11.0