From 78bbc62f0844b2fcbbc690e93327ce62c52493c7 Mon Sep 17 00:00:00 2001 From: Kevin Heifner Date: Fri, 22 Mar 2024 15:18:06 -0500 Subject: [PATCH] GH-2286 Add an irreversible node to test --- tests/transition_to_if.py | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/tests/transition_to_if.py b/tests/transition_to_if.py index 0263fb44f0..5966083c6b 100755 --- a/tests/transition_to_if.py +++ b/tests/transition_to_if.py @@ -22,7 +22,7 @@ topo=args.s debug=args.v prod_count = 1 # per node prod count -total_nodes=pnodes +total_nodes=pnodes+1 dumpErrorDetails=args.dump_error_details Utils.Debug=debug @@ -41,8 +41,9 @@ numTrxGenerators=2 Print("Stand up cluster") # For now do not load system contract as it does not support setfinalizer + specificExtraNodeosArgs = { 4: "--read-mode irreversible"} if cluster.launch(pnodes=pnodes, totalNodes=total_nodes, prodCount=prod_count, maximumP2pPerHost=total_nodes+numTrxGenerators, topo=topo, delay=delay, loadSystemContract=False, - activateIF=False) is False: + activateIF=False, specificExtraNodeosArgs=specificExtraNodeosArgs) is False: errorExit("Failed to stand up eos cluster.") assert cluster.biosNode.getInfo(exitOnError=True)["head_block_producer"] != "eosio", "launch should have waited for production to change" @@ -63,7 +64,9 @@ assert cluster.biosNode.waitForLibToAdvance(), "Lib should advance after instant finality activated" assert cluster.biosNode.waitForProducer("defproducera"), "Did not see defproducera" assert cluster.biosNode.waitForHeadToAdvance(blocksToAdvance=13) # into next producer - assert cluster.biosNode.waitForLibToAdvance(), "Lib stopped advancing" + assert cluster.biosNode.waitForLibToAdvance(), "Lib stopped advancing on biosNode" + assert cluster.getNode(1).waitForLibToAdvance(), "Lib stopped advancing on Node 1" + assert cluster.getNode(4).waitForLibToAdvance(), "Lib stopped advancing on Node 4, irreversible node" 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" @@ -76,8 +79,9 @@ # should take effect in first block of defproducerg slot (so defproducerh) assert cluster.setProds(["defproducerb", "defproducerh", "defproducerm", "defproducerr"]), "setprods failed" setProdsBlockNum = cluster.biosNode.getBlockNum() - cluster.biosNode.waitForBlock(setProdsBlockNum+12+12+1) + assert cluster.biosNode.waitForBlock(setProdsBlockNum+12+12+1), "Block of new producers not reached" assert cluster.biosNode.getInfo(exitOnError=True)["head_block_producer"] == "defproducerh", "setprods should have taken effect" + assert cluster.getNode(4).waitForBlock(setProdsBlockNum + 12 + 12 + 1), "Block of new producers not reached on irreversible node" testSuccessful=True finally: