Skip to content

Commit

Permalink
Merge pull request #1068 from AntelopeIO/GH-1055-waitForBlock
Browse files Browse the repository at this point in the history
Test: Update waitForBlock
  • Loading branch information
heifner authored Dec 17, 2024
2 parents 7ae614b + 4b416ac commit 2c1f812
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion tests/TestHarness/Node.py
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
2 changes: 1 addition & 1 deletion tests/disaster_recovery_2.py
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
4 changes: 2 additions & 2 deletions tests/disaster_recovery_3.py
Original file line number Diff line number Diff line change
Expand Up @@ -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}"

Expand Down
4 changes: 2 additions & 2 deletions tests/nodeos_forked_chain_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -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})

Expand Down

0 comments on commit 2c1f812

Please sign in to comment.