aboutsummaryrefslogtreecommitdiffstats
path: root/integration_test
diff options
context:
space:
mode:
authorJimmy Hu <jimmy.hu@dexon.org>2019-01-10 18:01:10 +0800
committerGitHub <noreply@github.com>2019-01-10 18:01:10 +0800
commitfa25817354d5b7d40f5911004232392acfe7fe53 (patch)
tree6e9c68971d4e5fecbd126568ebdb7f1026935d93 /integration_test
parent995e571375298923bf07d205237a664b03de3b57 (diff)
downloaddexon-consensus-fa25817354d5b7d40f5911004232392acfe7fe53.tar
dexon-consensus-fa25817354d5b7d40f5911004232392acfe7fe53.tar.gz
dexon-consensus-fa25817354d5b7d40f5911004232392acfe7fe53.tar.bz2
dexon-consensus-fa25817354d5b7d40f5911004232392acfe7fe53.tar.lz
dexon-consensus-fa25817354d5b7d40f5911004232392acfe7fe53.tar.xz
dexon-consensus-fa25817354d5b7d40f5911004232392acfe7fe53.tar.zst
dexon-consensus-fa25817354d5b7d40f5911004232392acfe7fe53.zip
core: fix issues in consensus core (#415)
Diffstat (limited to 'integration_test')
-rw-r--r--integration_test/consensus_test.go11
1 files changed, 9 insertions, 2 deletions
diff --git a/integration_test/consensus_test.go b/integration_test/consensus_test.go
index fa62bda..99de7c9 100644
--- a/integration_test/consensus_test.go
+++ b/integration_test/consensus_test.go
@@ -220,6 +220,7 @@ func (s *ConsensusTestSuite) TestSimple() {
nodes := s.setupNodes(dMoment, prvKeys, seedGov)
for _, n := range nodes {
go n.con.Run()
+ defer n.con.Stop()
}
Loop:
for {
@@ -236,7 +237,6 @@ Loop:
break
}
s.verifyNodes(nodes)
- // TODO(haoping) stop consensus.
}
func (s *ConsensusTestSuite) TestNumChainsChange() {
@@ -300,6 +300,7 @@ func (s *ConsensusTestSuite) TestNumChainsChange() {
// Run test.
for _, n := range nodes {
go n.con.Run()
+ defer n.con.Stop()
}
Loop:
for {
@@ -359,6 +360,9 @@ func (s *ConsensusTestSuite) TestSync() {
for _, n := range nodes {
if n.ID != syncNode.ID {
go n.con.Run()
+ if n.ID != stoppedNode.ID {
+ defer n.con.Stop()
+ }
}
}
// Clean syncNode's network receive channel, or it might exceed the limit
@@ -415,6 +419,10 @@ ReachAlive:
if syncedCon != nil {
syncNode.con = syncedCon
go syncNode.con.Run()
+ go func() {
+ <-runnerCtx.Done()
+ syncNode.con.Stop()
+ }()
break SyncLoop
}
if err != nil {
@@ -465,7 +473,6 @@ ReachAlive:
req.NoError(err)
case <-runnerCtx.Done():
// This test passed.
- // TODO(haoping) stop consensus.
}
}