From 4d45f4cd99935dc1e93393b17c53d2a29e10afa5 Mon Sep 17 00:00:00 2001 From: Kevin Heifner Date: Thu, 12 Dec 2024 08:27:16 -0600 Subject: [PATCH 1/2] GH-1055 Modify Node waitForBlock to wait on the provided blockNum instead of blockNum+1 --- tests/TestHarness/Node.py | 2 +- tests/disaster_recovery_2.py | 2 +- tests/disaster_recovery_3.py | 4 ++-- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/tests/TestHarness/Node.py b/tests/TestHarness/Node.py index d8aaab87a3..f58d9259f8 100644 --- a/tests/TestHarness/Node.py +++ b/tests/TestHarness/Node.py @@ -188,7 +188,7 @@ def waitForNextBlock(self, timeout=None, blockType=BlockType.head): return ret def waitForBlock(self, blockNum, timeout=None, blockType=BlockType.head, reportInterval=None): - lam = lambda: self.getBlockNum(blockType=blockType) > blockNum + lam = lambda: self.getBlockNum(blockType=blockType) >= blockNum blockDesc = "head" if blockType == BlockType.head else "LIB" count = 0 diff --git a/tests/disaster_recovery_2.py b/tests/disaster_recovery_2.py index 4e1ec06c49..d2e29c56e4 100755 --- a/tests/disaster_recovery_2.py +++ b/tests/disaster_recovery_2.py @@ -105,7 +105,7 @@ Print("Resume production on Node0") node0.processUrllibRequest("producer", "resume") - assert node0.waitForIrreversibleBlock(lib) # lib, not lib+1 because waitForIrreversibleBlock uses > + assert node0.waitForIrreversibleBlock(lib+1) libN = node0.getIrreversibleBlockNum() assert libN > lib diff --git a/tests/disaster_recovery_3.py b/tests/disaster_recovery_3.py index bbf7c14221..b9f3fb66f0 100755 --- a/tests/disaster_recovery_3.py +++ b/tests/disaster_recovery_3.py @@ -96,8 +96,8 @@ assert not node.verifyAlive(), "Node did not shutdown" Print("Wait for lib to advance to LIB N on other 2 nodes") - for node in [node2, node3]: # waitForBlock uses > not >=. node2 & node3 have lib of n_LIB - assert node.waitForBlock(n_LIB-1, timeout=None, blockType=BlockType.lib), "Node did not advance LIB after shutdown of node0 and node1" + for node in [node2, node3]: + assert node.waitForBlock(n_LIB, timeout=None, blockType=BlockType.lib), "Node did not advance LIB after shutdown of node0 and node1" currentLIB = node.getIrreversibleBlockNum() assert currentLIB == n_LIB, f"Node advanced LIB {currentLIB} beyond N LIB {n_LIB}" From 8187a07b2def00112724c8d57795e39e14eaf496 Mon Sep 17 00:00:00 2001 From: Kevin Heifner Date: Thu, 12 Dec 2024 11:32:18 -0600 Subject: [PATCH 2/2] GH-1055 Add larger timeout --- tests/nodeos_forked_chain_test.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/nodeos_forked_chain_test.py b/tests/nodeos_forked_chain_test.py index 8c3b8e6f9b..b8596d1821 100755 --- a/tests/nodeos_forked_chain_test.py +++ b/tests/nodeos_forked_chain_test.py @@ -500,8 +500,8 @@ def getBlock(self, blockNum): Print("Tracking the blocks from the divergence till there are 10*12 blocks on one chain and 10*12+1 on the other, from block %d to %d" % (killBlockNum, lastBlockNum)) for blockNum in range(killBlockNum,lastBlockNum): - blockProducer0=prodNodes[0].getBlockProducerByNum(blockNum) - blockProducer1=prodNodes[1].getBlockProducerByNum(blockNum) + blockProducer0=prodNodes[0].getBlockProducerByNum(blockNum, timeout=70) + blockProducer1=prodNodes[1].getBlockProducerByNum(blockNum, timeout=70) blockProducers0.append({"blockNum":blockNum, "prod":blockProducer0}) blockProducers1.append({"blockNum":blockNum, "prod":blockProducer1})