aboutsummaryrefslogtreecommitdiffstats
path: root/integration_test
diff options
context:
space:
mode:
authorMission Liao <mission.liao@dexon.org>2018-12-18 15:38:51 +0800
committerGitHub <noreply@github.com>2018-12-18 15:38:51 +0800
commit9f240d93507cdf03935ba7e4e3a7b226f150736d (patch)
tree3234b308e164aec346e6127be18060fc641867fd /integration_test
parentff845cd0bddcaacb8d88da9296af22a45fef1dff (diff)
downloaddexon-consensus-9f240d93507cdf03935ba7e4e3a7b226f150736d.tar
dexon-consensus-9f240d93507cdf03935ba7e4e3a7b226f150736d.tar.gz
dexon-consensus-9f240d93507cdf03935ba7e4e3a7b226f150736d.tar.bz2
dexon-consensus-9f240d93507cdf03935ba7e4e3a7b226f150736d.tar.lz
dexon-consensus-9f240d93507cdf03935ba7e4e3a7b226f150736d.tar.xz
dexon-consensus-9f240d93507cdf03935ba7e4e3a7b226f150736d.tar.zst
dexon-consensus-9f240d93507cdf03935ba7e4e3a7b226f150736d.zip
syncer: fix stuffs (#373)
* Add a new method: GetSyncedConsensus This method avoids calling BlockDelivered in SyncBlocks methods, which avoid potential deadlock. * Add a method to stop the syncer before synced * Enable nonBlockingApp for synced Consensus instance.
Diffstat (limited to 'integration_test')
-rw-r--r--integration_test/consensus_test.go9
1 files changed, 7 insertions, 2 deletions
diff --git a/integration_test/consensus_test.go b/integration_test/consensus_test.go
index 08a1d10..2680cd2 100644
--- a/integration_test/consensus_test.go
+++ b/integration_test/consensus_test.go
@@ -145,8 +145,13 @@ func (s *ConsensusTestSuite) syncBlocksWithSomeNode(
syncNode.gov.CatchUpWithRound(
b.Position.Round + core.ConfigRoundShift)
}
- syncedCon, err = syncerObj.SyncBlocks(compactionChainBlocks, true)
- if syncedCon != nil || err != nil {
+ var synced bool
+ synced, err = syncerObj.SyncBlocks(compactionChainBlocks, true)
+ if err != nil {
+ done = true
+ }
+ if synced {
+ syncedCon, err = syncerObj.GetSyncedConsensus()
done = true
}
compactionChainBlocks = nil