From d23dc19e95527da6fd5361c40eefc1b45a1a15a0 Mon Sep 17 00:00:00 2001 From: Lin Huang Date: Tue, 19 Jan 2021 11:07:21 -0500 Subject: [PATCH] Fix intermittent forked chain test failure --- tests/nodeos_forked_chain_test.py | 2 +- tests/nodeos_short_fork_take_over_test.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/nodeos_forked_chain_test.py b/tests/nodeos_forked_chain_test.py index e7cc92f26f0..7da64847e18 100755 --- a/tests/nodeos_forked_chain_test.py +++ b/tests/nodeos_forked_chain_test.py @@ -399,7 +399,7 @@ def getBlock(self, blockNum): Print("Tracking block producers from %d till divergence or %d. Head block is %d and lowest LIB is %d" % (preKillBlockNum, lastBlockNum, headBlockNum, libNumAroundDivergence)) transitionCount=0 missedTransitionBlock=None - for blockNum in range(preKillBlockNum,lastBlockNum): + for blockNum in range(preKillBlockNum,lastBlockNum + 1): #avoiding getting LIB until my current block passes the head from the last time I checked if blockNum>headBlockNum: (headBlockNum, libNumAroundDivergence)=getMinHeadAndLib(prodNodes) diff --git a/tests/nodeos_short_fork_take_over_test.py b/tests/nodeos_short_fork_take_over_test.py index 77d30c72dcc..c88f5745716 100755 --- a/tests/nodeos_short_fork_take_over_test.py +++ b/tests/nodeos_short_fork_take_over_test.py @@ -250,7 +250,7 @@ def getMinHeadAndLib(prodNodes): Print("Tracking block producers from %d till divergence or %d. Head block is %d and lowest LIB is %d" % (preKillBlockNum, lastBlockNum, headBlockNum, libNumAroundDivergence)) transitionCount=0 missedTransitionBlock=None - for blockNum in range(preKillBlockNum,lastBlockNum): + for blockNum in range(preKillBlockNum,lastBlockNum + 1): #avoiding getting LIB until my current block passes the head from the last time I checked if blockNum>headBlockNum: (headBlockNum, libNumAroundDivergence)=getMinHeadAndLib(prodNodes)