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

Test: Update test to try a few times for a full set of voting finalizers #518

Merged
merged 1 commit into from
Aug 12, 2024
Merged
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
22 changes: 14 additions & 8 deletions tests/separate_prod_fin_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -66,15 +66,21 @@
info = cluster.biosNode.getInfo(exitOnError=True)
assert (info["head_block_num"] - info["last_irreversible_block_num"]) < 9, "Instant finality enabled LIB diff should be small"

# LIB has advanced, which indicate at least 2 of non-producer finalizers have voted.
# Double check that's indeed the case in qc_extension
info = cluster.getNode(1).getInfo(exitOnError=True)
block_num = info["last_irreversible_block_num"]
block = cluster.getNode(1).getBlock(block_num)
qc_ext = block["qc_extension"]
Print(f'{qc_ext}')
# "11111" is the representation of a bitset showing which finalizers have voted (we have five total finalizers)
assert qc_ext["qc"]["active_policy_sig"]["strong_votes"] == "11111", 'Not all finalizers voted'
i = 0
while i < 3: # slow ci/cd might not get all votes in time, try a few blocks
# LIB has advanced, which indicate at least 2 of non-producer finalizers have voted.
block_num = cluster.getNode(1).getIrreversibleBlockNum()
block = cluster.getNode(1).getBlock(block_num)
qc_ext = block["qc_extension"]
Print(f'{qc_ext}')
# "11111" is the representation of a bitset showing which finalizers have voted (we have five total finalizers)
if qc_ext["qc"]["active_policy_sig"]["strong_votes"] == "11111":
break
cluster.getNode(1).waitForLibToAdvance()
i += 1
assert i < 3, "Not all finalizers voted"


testSuccessful=True
finally:
Expand Down