diff --git a/tests/Node.py b/tests/Node.py index 8a0e6ca58cb8e1acf78e2af6c8fa2b524e1af1b3..2338c1a62932977aa321688ae177b53bdbe98b2c 100644 --- a/tests/Node.py +++ b/tests/Node.py @@ -302,7 +302,8 @@ class Node(object): assert(transId) assert(isinstance(transId, str)) trans=self.getTransaction(transId) - assert(trans) + if trans is None: + return None refBlockNum=None key="" @@ -549,6 +550,7 @@ class Node(object): def waitForTransInBlock(self, transId, timeout=None): """Wait for trans id to be finalized.""" + assert(isinstance(transId, str)) lam = lambda: self.isTransInAnyBlock(transId) ret=Utils.waitForBool(lam, timeout) return ret diff --git a/tests/nodeos_voting_test.py b/tests/nodeos_voting_test.py index 009443b5b760455aba56e13233a336f4be5648c1..3453be747075e0d4e06649208a9dc4c0b7843ad8 100755 --- a/tests/nodeos_voting_test.py +++ b/tests/nodeos_voting_test.py @@ -69,12 +69,15 @@ def validBlockProducer(prodsActive, prodsSeen, blockNum, node): def getNextCleanProductionCycle(trans, node): transId=Node.getTransId(trans) - rounds=15*12*2 # 2/3+1 of producers x blocks per producer x at least 2 times + rounds=21*12*2 # max time to ensure that at least 2/3+1 of producers x blocks per producer x at least 2 times node.waitForTransFinalization(transId, timeout=rounds/2) irreversibleBlockNum=node.getIrreversibleBlockNum() - # The voted schedule should be promoted now, then need to wait for that to become irreversible - promotedBlockNum=node.getHeadBlockNum()+240 + + # The voted schedule should be promoted now, then need to wait for that to become irreversible + votingTallyWindow=120 #could be up to 120 blocks before the votes were tallied + promotedBlockNum=node.getHeadBlockNum()+votingTallyWindow node.waitForIrreversibleBlock(promotedBlockNum, timeout=rounds/2) + ibnSchedActive=node.getIrreversibleBlockNum() blockNum=node.getHeadBlockNum()