From ac88b89a23087e87195c6f4b3f64371c06bac81e Mon Sep 17 00:00:00 2001 From: greg7mdp Date: Thu, 15 Feb 2024 17:56:24 -0500 Subject: [PATCH] Remove broken `large-lib-test.py` --- tests/CMakeLists.txt | 5 -- tests/large-lib-test.py | 116 ---------------------------------------- 2 files changed, 121 deletions(-) delete mode 100755 tests/large-lib-test.py diff --git a/tests/CMakeLists.txt b/tests/CMakeLists.txt index d52cbe1e2b..a3d56c50ae 100644 --- a/tests/CMakeLists.txt +++ b/tests/CMakeLists.txt @@ -47,7 +47,6 @@ configure_file(${CMAKE_CURRENT_SOURCE_DIR}/nodeos_producer_watermark_test.py ${C configure_file(${CMAKE_CURRENT_SOURCE_DIR}/cli_test.py ${CMAKE_CURRENT_BINARY_DIR}/cli_test.py COPYONLY) configure_file(${CMAKE_CURRENT_SOURCE_DIR}/ship_test.py ${CMAKE_CURRENT_BINARY_DIR}/ship_test.py COPYONLY) configure_file(${CMAKE_CURRENT_SOURCE_DIR}/ship_streamer_test.py ${CMAKE_CURRENT_BINARY_DIR}/ship_streamer_test.py COPYONLY) -configure_file(${CMAKE_CURRENT_SOURCE_DIR}/large-lib-test.py ${CMAKE_CURRENT_BINARY_DIR}/large-lib-test.py COPYONLY) configure_file(${CMAKE_CURRENT_SOURCE_DIR}/lib_advance_test.py ${CMAKE_CURRENT_BINARY_DIR}/lib_advance_test.py COPYONLY) configure_file(${CMAKE_CURRENT_SOURCE_DIR}/http_plugin_test.py ${CMAKE_CURRENT_BINARY_DIR}/http_plugin_test.py COPYONLY) configure_file(${CMAKE_CURRENT_SOURCE_DIR}/p2p_high_latency_test.py ${CMAKE_CURRENT_BINARY_DIR}/p2p_high_latency_test.py COPYONLY) @@ -69,7 +68,6 @@ configure_file(${CMAKE_CURRENT_SOURCE_DIR}/resource_monitor_plugin_test.py ${CMA configure_file(${CMAKE_CURRENT_SOURCE_DIR}/light_validation_sync_test.py ${CMAKE_CURRENT_BINARY_DIR}/light_validation_sync_test.py COPYONLY) configure_file(${CMAKE_CURRENT_SOURCE_DIR}/trace_plugin_test.py ${CMAKE_CURRENT_BINARY_DIR}/trace_plugin_test.py COPYONLY) configure_file(${CMAKE_CURRENT_SOURCE_DIR}/nested_container_multi_index_test.py ${CMAKE_CURRENT_BINARY_DIR}/nested_container_multi_index_test.py COPYONLY) -configure_file(${CMAKE_CURRENT_SOURCE_DIR}/large-lib-test.py ${CMAKE_CURRENT_BINARY_DIR}/large-lib-test.py COPYONLY) configure_file(${CMAKE_CURRENT_SOURCE_DIR}/auto_bp_peering_test.py ${CMAKE_CURRENT_BINARY_DIR}/auto_bp_peering_test.py COPYONLY) configure_file(${CMAKE_CURRENT_SOURCE_DIR}/auto_bp_peering_test_shape.json ${CMAKE_CURRENT_BINARY_DIR}/auto_bp_peering_test_shape.json COPYONLY) configure_file(${CMAKE_CURRENT_SOURCE_DIR}/gelf_test.py ${CMAKE_CURRENT_BINARY_DIR}/gelf_test.py COPYONLY) @@ -243,9 +241,6 @@ set_property(TEST nodeos_retry_transaction_lr_test PROPERTY LABELS long_running_ add_test(NAME cli_test COMMAND tests/cli_test.py WORKING_DIRECTORY ${CMAKE_BINARY_DIR}) set_property(TEST cli_test PROPERTY LABELS nonparallelizable_tests) -add_test(NAME larger_lib_test COMMAND tests/large-lib-test.py ${UNSHARE} WORKING_DIRECTORY ${CMAKE_BINARY_DIR}) -set_property(TEST larger_lib_test PROPERTY LABELS nonparallelizable_tests) - add_test(NAME lib_advance_test COMMAND tests/lib_advance_test.py -v ${UNSHARE} WORKING_DIRECTORY ${CMAKE_BINARY_DIR}) set_property(TEST lib_advance_test PROPERTY LABELS nonparallelizable_tests) diff --git a/tests/large-lib-test.py b/tests/large-lib-test.py deleted file mode 100755 index 6c5138b4b1..0000000000 --- a/tests/large-lib-test.py +++ /dev/null @@ -1,116 +0,0 @@ -#!/usr/bin/env python3 - -import random -import signal -import time - -from TestHarness import Cluster, Node, ReturnType, TestHelper, Utils, WalletMgr -from TestHarness.Node import BlockType - -############################################################### -# large-lib-test -# -# Test LIB in a network will advance when an invalid larger LIB -# than current one is received from a speculative node. -# -############################################################### - - -Print=Utils.Print -errorExit=Utils.errorExit - -args=TestHelper.parse_args({"--kill-sig","--kill-count","--keep-logs" - ,"--dump-error-details","-v","--leave-running","--unshared" - }) -pnodes=1 -total_nodes=3 # first one is producer, and last two are speculative nodes -debug=args.v -dumpErrorDetails=args.dump_error_details -relaunchTimeout=10 -# Don't want to set too big, trying to reduce test time, but needs to be large enough for test to finish before -# restart re-creates this many blocks. -numBlocksToProduceBeforeRelaunch=80 -numBlocksToWaitBeforeChecking=20 - -Utils.Debug=debug -testSuccessful=False - -seed=1 -random.seed(seed) # Use a fixed seed for repeatability. -cluster=Cluster(unshared=args.unshared, keepRunning=args.leave_running, keepLogs=args.keep_logs) -walletMgr=WalletMgr(True) -cluster.setWalletMgr(walletMgr) - -def relaunchNode(node: Node, chainArg="", skipGenesis=True, relaunchAssertMessage="Fail to relaunch"): - isRelaunchSuccess=node.relaunch(chainArg=chainArg, timeout=relaunchTimeout, skipGenesis=skipGenesis) - time.sleep(1) # Give a second to replay or resync if needed - assert isRelaunchSuccess, relaunchAssertMessage - return isRelaunchSuccess - -try: - TestHelper.printSystemInfo("BEGIN") - - Print("Stand up cluster") - if cluster.launch( - pnodes=pnodes, - totalNodes=total_nodes, - totalProducers=1, - topo="mesh") is False: - errorExit("Failed to stand up eos cluster.") - - producingNode=cluster.getNode(0) - speculativeNode1=cluster.getNode(1) - speculativeNode2=cluster.getNode(2) - - Print ("Wait for Cluster stabilization") - if not cluster.waitOnClusterBlockNumSync(3): - errorExit("Cluster never stabilized") - Print ("Cluster stabilized") - - Print("Wait for producing {} blocks".format(numBlocksToProduceBeforeRelaunch)) - producingNode.waitForBlock(numBlocksToProduceBeforeRelaunch, blockType=BlockType.lib) - producingNode.waitForProducer("defproducera") - - Print("Kill all node instances.") - for clusterNode in cluster.nodes: - clusterNode.kill(signal.SIGTERM) - cluster.biosNode.kill(signal.SIGTERM) - Print("All nodeos instances killed.") - - # Remove both state and blocks such that no replay happens - Print("Remove producer node's state and blocks directories") - Utils.rmNodeDataDir(0) - Print("Remove the second speculative node's state and blocks directories") - Utils.rmNodeDataDir(2) - - Print ("Relaunch all cluster nodes instances.") - # -e for resuming production, defproducera only producer at this point - # skipGenesis=False for launch the same chain as before - relaunchNode(producingNode, chainArg="-e --sync-fetch-span 5 ", skipGenesis=False) - relaunchNode(speculativeNode1, chainArg="--sync-fetch-span 5 ") - relaunchNode(speculativeNode2, chainArg="--sync-fetch-span 5 ", skipGenesis=False) - - Print("Note LIBs") - prodLib = producingNode.getIrreversibleBlockNum() - specLib1 = speculativeNode1.getIrreversibleBlockNum() - specLib2 = speculativeNode2.getIrreversibleBlockNum() - Print("prodLib {}, specLib1 {}, specLib2 {},".format(prodLib, specLib1, specLib2)) - - Print("Wait for {} blocks to produce".format(numBlocksToWaitBeforeChecking)) - speculativeNode2.waitForBlock( specLib2 + numBlocksToWaitBeforeChecking, blockType=BlockType.lib) - - Print("Check whether LIBs advance or not") - prodLibAfterWait = producingNode.getIrreversibleBlockNum() - specLibAfterWait1 = speculativeNode1.getIrreversibleBlockNum() - specLibAfterWait2 = speculativeNode2.getIrreversibleBlockNum() - Print("prodLibAfterWait {}, specLibAfterWait1 {}, specLibAfterWait2 {},".format(prodLibAfterWait, specLibAfterWait1, specLibAfterWait2)) - - assert prodLibAfterWait > prodLib and specLibAfterWait2 > specLib2, "Either producer ({} -> {})/ second speculative node ({} -> {}) is not advancing".format(prodLib, prodLibAfterWait, specLib2, specLibAfterWait2) - - testSuccessful=True - -finally: - TestHelper.shutdown(cluster, walletMgr, testSuccessful=testSuccessful, dumpErrorDetails=dumpErrorDetails) - -exitCode = 0 if testSuccessful else 1 -exit(exitCode)