Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[1.0.3] Test: Fix flakey production_pause_max_rev_blks_test #960

Open
wants to merge 1 commit into
base: release/1.0
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions tests/TestHarness/Node.py
Original file line number Diff line number Diff line change
Expand Up @@ -259,6 +259,13 @@ def isLibAdvancing():
return self.getIrreversibleBlockNum() > currentLib
return Utils.waitForBool(isLibAdvancing, timeout)

def waitForLibNotToAdvance(self, timeout=30):
endTime=time.time()+timeout
while self.waitForLibToAdvance(timeout=timeout):
if time.time() > endTime:
return False
return True

def waitForProducer(self, producer, timeout=None, exitOnError=False):
if timeout is None:
# default to the typical configuration of 21 producers, each producing 12 blocks in a row (every 1/2 second)
Expand Down
7 changes: 3 additions & 4 deletions tests/production_pause_max_rev_blks_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -118,10 +118,9 @@

# Verify LIB stalled on node0 and producerbNode due to finalizerNode was shutdown
Print("Verify LIB stalled after shutdown of finalizerbNode")
if producerbNode.waitForLibToAdvance(timeout=5): # LIB can advance for a few blocks first
assert not producerbNode.waitForLibToAdvance(timeout=5), "LIB should not advance on producerbNode after finalizerbNode was shutdown"
if node0.waitForLibToAdvance(timeout=5): # LIB can advance for a few blocks first
assert not node0.waitForLibToAdvance(timeout=5), "LIB should not advance on node0 after finalizerbNode was shutdown"
# LIB can advance for a few blocks first
assert producerbNode.waitForLibNotToAdvance(timeout=10), "LIB should not advance on producerbNode after finalizerbNode was shutdown"
assert node0.waitForLibNotToAdvance(timeout=10), "LIB should not advance on node0 after finalizerbNode was shutdown"

# Wait until enough reversible blocks are produced
node0.getInfo()
Expand Down