diff --git a/tests/TestHarness/Node.py b/tests/TestHarness/Node.py index 888048d6dd..b529990b6f 100644 --- a/tests/TestHarness/Node.py +++ b/tests/TestHarness/Node.py @@ -146,10 +146,10 @@ def validateAccounts(self, accounts): Utils.Print("account validation failed. account: %s" % (account.name)) raise - def waitForTransactionInBlock(self, transId, timeout=None): + def waitForTransactionInBlock(self, transId, timeout=None, exitOnError=True): """Wait for trans id to appear in a block.""" assert(isinstance(transId, str)) - lam = lambda: self.isTransInAnyBlock(transId) + lam = lambda: self.isTransInAnyBlock(transId, exitOnError=exitOnError) ret=Utils.waitForBool(lam, timeout) return ret @@ -226,7 +226,7 @@ def waitForTransBlockIfNeeded(self, trans, waitForTransBlock, exitOnError=False) if not waitForTransBlock: return trans transId=NodeosQueries.getTransId(trans) - if not self.waitForTransactionInBlock(transId): + if not self.waitForTransactionInBlock(transId, exitOnError=exitOnError): if exitOnError: Utils.cmdError("transaction with id %s never made it into a block" % (transId)) Utils.errorExit("Failed to find transaction with id %s in a block before timeout" % (transId)) diff --git a/tests/TestHarness/queries.py b/tests/TestHarness/queries.py index aa28521476..d7b3695fd2 100644 --- a/tests/TestHarness/queries.py +++ b/tests/TestHarness/queries.py @@ -319,11 +319,11 @@ def getBlockNumByTransId(self, transId, exitOnError=True, delayedRetry=True, blo return None - def isTransInAnyBlock(self, transId: str): + def isTransInAnyBlock(self, transId: str, exitOnError=True): """Check if transaction (transId) is in a block.""" assert(transId) assert(isinstance(transId, str)) - blockId=self.getBlockNumByTransId(transId) + blockId=self.getBlockNumByTransId(transId, exitOnError=exitOnError) return True if blockId else False def isTransFinalized(self, transId): diff --git a/tests/TestHarness/transactions.py b/tests/TestHarness/transactions.py index b6d5d4a5c7..5950a8b42e 100644 --- a/tests/TestHarness/transactions.py +++ b/tests/TestHarness/transactions.py @@ -203,7 +203,7 @@ def publishContract(self, account, contractDir, wasmFile, abiFile, waitForTransB if not waitForTransBlock: return trans transId=NodeosQueries.getTransId(trans) - if self.waitForTransactionInBlock(transId, timeout=5): + if self.waitForTransactionInBlock(transId, timeout=5, exitOnError=False): break return trans