diff options
author | Mission Liao <mission.liao@dexon.org> | 2019-02-20 12:53:18 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-02-20 12:53:18 +0800 |
commit | 8ef4fc213703620fbfa13890dee042d40eea8545 (patch) | |
tree | ba9a07d2423314396e5677b7294122caa505ae9a /integration_test/byzantine_test.go | |
parent | 2cf18fd299ea0fc270b213343314cab652cac271 (diff) | |
download | tangerine-consensus-8ef4fc213703620fbfa13890dee042d40eea8545.tar tangerine-consensus-8ef4fc213703620fbfa13890dee042d40eea8545.tar.gz tangerine-consensus-8ef4fc213703620fbfa13890dee042d40eea8545.tar.bz2 tangerine-consensus-8ef4fc213703620fbfa13890dee042d40eea8545.tar.lz tangerine-consensus-8ef4fc213703620fbfa13890dee042d40eea8545.tar.xz tangerine-consensus-8ef4fc213703620fbfa13890dee042d40eea8545.tar.zst tangerine-consensus-8ef4fc213703620fbfa13890dee042d40eea8545.zip |
core: switch round by block height (#450)
Diffstat (limited to 'integration_test/byzantine_test.go')
-rw-r--r-- | integration_test/byzantine_test.go | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/integration_test/byzantine_test.go b/integration_test/byzantine_test.go index fac8c0a..027b6e7 100644 --- a/integration_test/byzantine_test.go +++ b/integration_test/byzantine_test.go @@ -18,6 +18,7 @@ package integration import ( + "context" "fmt" "sync" "testing" @@ -143,7 +144,7 @@ func (s *ByzantineTestSuite) TestOneSlowNodeOneDeadNode() { core.ConfigRoundShift) req.NoError(err) req.NoError(seedGov.State().RequestChange( - test.StateChangeRoundInterval, 100*time.Second)) + test.StateChangeRoundInterval, uint64(60))) slowNodeID := types.NewNodeID(pubKeys[0]) deadNodeID := types.NewNodeID(pubKeys[1]) s.directLatencyModel[slowNodeID] = &test.FixedLatencyModel{ @@ -157,6 +158,11 @@ func (s *ByzantineTestSuite) TestOneSlowNodeOneDeadNode() { go n.con.Run() defer n.con.Stop() } + // Clean deadNode's network receive channel, or it might exceed the limit + // and block other go routines. + dummyReceiverCtxCancel, _ := utils.LaunchDummyReceiver( + context.Background(), nodes[deadNodeID].network.ReceiveChan(), nil) + defer dummyReceiverCtxCancel() Loop: for { <-time.After(5 * time.Second) |