From c20f698993f521fa4bb4187ee9483d0bf4883160 Mon Sep 17 00:00:00 2001 From: Kevin Heifner Date: Mon, 12 Aug 2024 07:10:05 -0500 Subject: [PATCH] GH-511 Update test to try a few times for a full set of voting finalizers --- tests/separate_prod_fin_test.py | 22 ++++++++++++++-------- 1 file changed, 14 insertions(+), 8 deletions(-) diff --git a/tests/separate_prod_fin_test.py b/tests/separate_prod_fin_test.py index dba7f8c952..8d48b77940 100755 --- a/tests/separate_prod_fin_test.py +++ b/tests/separate_prod_fin_test.py @@ -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: