aboutsummaryrefslogtreecommitdiffstats
path: root/core/agreement-mgr.go
diff options
context:
space:
mode:
authorMission Liao <mission.liao@dexon.org>2019-03-18 17:06:38 +0800
committerJimmy Hu <jimmy.hu@dexon.org>2019-03-18 17:06:38 +0800
commit9e97ddc00c67ee13ceb8fc597f4f55cfd6df6101 (patch)
treea9c3c3c9520fca2205c5eef9b1355a5db0fca539 /core/agreement-mgr.go
parent89dddf787c9360f0fed76738fb515be30c7d73bc (diff)
downloaddexon-consensus-9e97ddc00c67ee13ceb8fc597f4f55cfd6df6101.tar
dexon-consensus-9e97ddc00c67ee13ceb8fc597f4f55cfd6df6101.tar.gz
dexon-consensus-9e97ddc00c67ee13ceb8fc597f4f55cfd6df6101.tar.bz2
dexon-consensus-9e97ddc00c67ee13ceb8fc597f4f55cfd6df6101.tar.lz
dexon-consensus-9e97ddc00c67ee13ceb8fc597f4f55cfd6df6101.tar.xz
dexon-consensus-9e97ddc00c67ee13ceb8fc597f4f55cfd6df6101.tar.zst
dexon-consensus-9e97ddc00c67ee13ceb8fc597f4f55cfd6df6101.zip
test: try to mitigate flaky tests (#498)
* Add assertion to make sure all nodes are synced. * Retry round event with BA's interval We are about to modify lambdaDKG with block height, instead of timing. Therefore, the last interval we could use is BA's interval. * Check ctx in inifite loop * Disable this panic temporary If a fast sync triggered by receiving types.AgreementResult from later position, this panic would be triggered 100%, ex. current-round: 1, change-notary-height: 120, agreeemnt-result from round:2 height:121 However, I don't have easy way to fix it temporary. * Lower down the test size for TCP * Fix typo * Fixup: revert the removed panic
Diffstat (limited to 'core/agreement-mgr.go')
-rw-r--r--core/agreement-mgr.go7
1 files changed, 7 insertions, 0 deletions
diff --git a/core/agreement-mgr.go b/core/agreement-mgr.go
index 0e39fa5..14aa385 100644
--- a/core/agreement-mgr.go
+++ b/core/agreement-mgr.go
@@ -432,6 +432,13 @@ func (mgr *agreementMgr) baRoutineForOneRound(
var nextHeight uint64
var nextTime time.Time
for {
+ // Make sure we are stoppable.
+ select {
+ case <-mgr.ctx.Done():
+ breakLoop = true
+ return
+ default:
+ }
nextHeight, nextTime = mgr.bcModule.nextBlock()
if isStop(oldPos) && nextHeight == 0 {
break