From a762416547d501463f8fa932156cd43e625c8a83 Mon Sep 17 00:00:00 2001 From: kayan Date: Tue, 17 Sep 2024 11:37:10 +0800 Subject: [PATCH 1/3] test web-socket fork test instablity --- tests/nodeos_eos_evm_ws_test_fork.py | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/tests/nodeos_eos_evm_ws_test_fork.py b/tests/nodeos_eos_evm_ws_test_fork.py index 633c1c0..90345a2 100755 --- a/tests/nodeos_eos_evm_ws_test_fork.py +++ b/tests/nodeos_eos_evm_ws_test_fork.py @@ -1084,22 +1084,30 @@ def makeReservedEvmAddress(account): blockProducers0=[] blockProducers1=[] + + Utils.Print("closing websocket") ws.close() testSuccessful= not foundErr except Exception as ex: Utils.Print("Exception:" + str(ex)) finally: + Utils.Print("shutting down cluster") TestHelper.shutdown(cluster, walletMgr, testSuccessful=testSuccessful, dumpErrorDetails=dumpErrorDetails) if killEosInstances: if evmNodePOpen is not None: + Utils.Print("killing evm-node pipe") evmNodePOpen.kill() if evmRPCPOpen is not None: + Utils.Print("killing evm-rpc-node pipe") evmRPCPOpen.kill() if eosEvmMinerPOpen is not None: + Utils.Print("killing miner pipe") eosEvmMinerPOpen.kill() if wsproxy is not None: + Utils.Print("killing wsproxy") wsproxy.kill() +Utils.Print("exit eos evm web-socket fork test") exitCode = 0 if testSuccessful else 1 exit(exitCode) From ab17671508c280ca4ccbb6982bf84873598b907b Mon Sep 17 00:00:00 2001 From: kayan Date: Fri, 20 Sep 2024 15:37:22 +0800 Subject: [PATCH 2/3] shutdown order fix --- tests/nodeos_eos_evm_different_token_test.py | 19 ++++++++------- tests/nodeos_eos_evm_gasparam_fork_test.py | 21 +++++++++------- tests/nodeos_eos_evm_test.py | 18 +++++++------- tests/nodeos_eos_evm_ws_test_basic.py | 21 +++++++++------- tests/nodeos_eos_evm_ws_test_fork.py | 25 ++++++++++---------- 5 files changed, 55 insertions(+), 49 deletions(-) diff --git a/tests/nodeos_eos_evm_different_token_test.py b/tests/nodeos_eos_evm_different_token_test.py index 22ac983..9fbe5ea 100755 --- a/tests/nodeos_eos_evm_different_token_test.py +++ b/tests/nodeos_eos_evm_different_token_test.py @@ -1020,15 +1020,16 @@ def get_block(num): testSuccessful= not foundErr finally: - TestHelper.shutdown(cluster, walletMgr, testSuccessful=testSuccessful, dumpErrorDetails=dumpErrorDetails) - if killEosInstances: - if evmNodePOpen is not None: - evmNodePOpen.kill() - if evmRPCPOpen is not None: - evmRPCPOpen.kill() - if eosEvmMinerPOpen is not None: - eosEvmMinerPOpen.kill() - + if evmNodePOpen is not None: + Utils.Print("killing eos-evm-node") + evmNodePOpen.kill() + if evmRPCPOpen is not None: + Utils.Print("killing eos-evm-rpc") + evmRPCPOpen.kill() + if eosEvmMinerPOpen is not None: + Utils.Print("killing evm-miner") + eosEvmMinerPOpen.kill() + TestHelper.shutdown(cluster, walletMgr, testSuccessful=testSuccessful, dumpErrorDetails=dumpErrorDetails) exitCode = 0 if testSuccessful else 1 exit(exitCode) diff --git a/tests/nodeos_eos_evm_gasparam_fork_test.py b/tests/nodeos_eos_evm_gasparam_fork_test.py index 8b69d1f..0bf3388 100755 --- a/tests/nodeos_eos_evm_gasparam_fork_test.py +++ b/tests/nodeos_eos_evm_gasparam_fork_test.py @@ -1095,16 +1095,19 @@ def makeReservedEvmAddress(account): testSuccessful= not foundErr finally: + if evmNodePOpen is not None: + Utils.Print("killing eos-evm-node") + evmNodePOpen.kill() + if evmRPCPOpen is not None: + Utils.Print("killing eos-evm-rpc") + evmRPCPOpen.kill() + if eosEvmMinerPOpen is not None: + Utils.Print("killing evm-miner") + eosEvmMinerPOpen.kill() + if wsproxy is not None: + Utils.Print("killing web-socket proxy") + wsproxy.kill() TestHelper.shutdown(cluster, walletMgr, testSuccessful=testSuccessful, dumpErrorDetails=dumpErrorDetails) - if killEosInstances: - if evmNodePOpen is not None: - evmNodePOpen.kill() - if evmRPCPOpen is not None: - evmRPCPOpen.kill() - if eosEvmMinerPOpen is not None: - eosEvmMinerPOpen.kill() - if wsproxy is not None: - wsproxy.kill() exitCode = 0 if testSuccessful else 1 exit(exitCode) diff --git a/tests/nodeos_eos_evm_test.py b/tests/nodeos_eos_evm_test.py index 0955d5b..b1593b3 100755 --- a/tests/nodeos_eos_evm_test.py +++ b/tests/nodeos_eos_evm_test.py @@ -1131,17 +1131,17 @@ def get_block(num): Utils.Print("test failed, ready to shut down cluster") finally: + if evmNodePOpen is not None: + Utils.Print("killing eos-evm-node") + evmNodePOpen.kill() + if evmRPCPOpen is not None: + Utils.Print("killing eos-evm-rpc") + evmRPCPOpen.kill() + if eosEvmMinerPOpen is not None: + Utils.Print("killing evm-miner") + eosEvmMinerPOpen.kill() Utils.Print("shutting down cluster") TestHelper.shutdown(cluster, walletMgr, testSuccessful=testSuccessful, dumpErrorDetails=dumpErrorDetails) - if killEosInstances: - Utils.Print("killing EOS instances") - if evmNodePOpen is not None: - evmNodePOpen.kill() - if evmRPCPOpen is not None: - evmRPCPOpen.kill() - if eosEvmMinerPOpen is not None: - eosEvmMinerPOpen.kill() - exitCode = 0 if testSuccessful else 1 exit(exitCode) diff --git a/tests/nodeos_eos_evm_ws_test_basic.py b/tests/nodeos_eos_evm_ws_test_basic.py index ab267b7..9786e72 100755 --- a/tests/nodeos_eos_evm_ws_test_basic.py +++ b/tests/nodeos_eos_evm_ws_test_basic.py @@ -784,16 +784,19 @@ def makeReservedEvmAddress(account): except Exception as ex: Utils.Print("Exception:" + str(ex)) finally: + if evmNodePOpen is not None: + Utils.Print("killing eos-evm-node") + evmNodePOpen.kill() + if evmRPCPOpen is not None: + Utils.Print("killing eos-evm-rpc") + evmRPCPOpen.kill() + if eosEvmMinerPOpen is not None: + Utils.Print("killing evm-miner") + eosEvmMinerPOpen.kill() + if wsproxy is not None: + Utils.Print("killing web-socket proxy") + wsproxy.kill() TestHelper.shutdown(cluster, walletMgr, testSuccessful=testSuccessful, dumpErrorDetails=dumpErrorDetails) - if killEosInstances: - if evmNodePOpen is not None: - evmNodePOpen.kill() - if evmRPCPOpen is not None: - evmRPCPOpen.kill() - if eosEvmMinerPOpen is not None: - eosEvmMinerPOpen.kill() - if wsproxy is not None: - wsproxy.kill() exitCode = 0 if testSuccessful else 1 exit(exitCode) diff --git a/tests/nodeos_eos_evm_ws_test_fork.py b/tests/nodeos_eos_evm_ws_test_fork.py index 90345a2..5d8dbf2 100755 --- a/tests/nodeos_eos_evm_ws_test_fork.py +++ b/tests/nodeos_eos_evm_ws_test_fork.py @@ -1092,21 +1092,20 @@ def makeReservedEvmAddress(account): except Exception as ex: Utils.Print("Exception:" + str(ex)) finally: + if evmNodePOpen is not None: + Utils.Print("killing eos-evm-node") + evmNodePOpen.kill() + if evmRPCPOpen is not None: + Utils.Print("killing eos-evm-rpc") + evmRPCPOpen.kill() + if eosEvmMinerPOpen is not None: + Utils.Print("killing evm-miner") + eosEvmMinerPOpen.kill() + if wsproxy is not None: + Utils.Print("killing web-socket proxy") + wsproxy.kill() Utils.Print("shutting down cluster") TestHelper.shutdown(cluster, walletMgr, testSuccessful=testSuccessful, dumpErrorDetails=dumpErrorDetails) - if killEosInstances: - if evmNodePOpen is not None: - Utils.Print("killing evm-node pipe") - evmNodePOpen.kill() - if evmRPCPOpen is not None: - Utils.Print("killing evm-rpc-node pipe") - evmRPCPOpen.kill() - if eosEvmMinerPOpen is not None: - Utils.Print("killing miner pipe") - eosEvmMinerPOpen.kill() - if wsproxy is not None: - Utils.Print("killing wsproxy") - wsproxy.kill() Utils.Print("exit eos evm web-socket fork test") exitCode = 0 if testSuccessful else 1 From 6e5b6c75ec2c092b61580f9cc6812fe4c0899933 Mon Sep 17 00:00:00 2001 From: kayan Date: Mon, 23 Sep 2024 17:12:46 +0800 Subject: [PATCH 3/3] use hard kill on nodeos --- tests/nodeos_eos_evm_different_token_test.py | 8 ++++++-- tests/nodeos_eos_evm_gasparam_fork_test.py | 7 ++++++- tests/nodeos_eos_evm_test.py | 9 ++++++--- tests/nodeos_eos_evm_ws_test_basic.py | 8 ++++++-- tests/nodeos_eos_evm_ws_test_fork.py | 9 ++++++--- 5 files changed, 30 insertions(+), 11 deletions(-) diff --git a/tests/nodeos_eos_evm_different_token_test.py b/tests/nodeos_eos_evm_different_token_test.py index 9fbe5ea..fa9ef42 100755 --- a/tests/nodeos_eos_evm_different_token_test.py +++ b/tests/nodeos_eos_evm_different_token_test.py @@ -1029,7 +1029,11 @@ def get_block(num): if eosEvmMinerPOpen is not None: Utils.Print("killing evm-miner") eosEvmMinerPOpen.kill() - TestHelper.shutdown(cluster, walletMgr, testSuccessful=testSuccessful, dumpErrorDetails=dumpErrorDetails) - + Utils.Print("killing nodeos") + for node in cluster.nodes: + node.kill(signal.SIGKILL) + if len(cluster.nodes) and cluster.biosNode != cluster.nodes[0]: + cluster.biosNode.kill(signal.SIGKILL) + exitCode = 0 if testSuccessful else 1 exit(exitCode) diff --git a/tests/nodeos_eos_evm_gasparam_fork_test.py b/tests/nodeos_eos_evm_gasparam_fork_test.py index 0bf3388..3be43ad 100755 --- a/tests/nodeos_eos_evm_gasparam_fork_test.py +++ b/tests/nodeos_eos_evm_gasparam_fork_test.py @@ -1107,7 +1107,12 @@ def makeReservedEvmAddress(account): if wsproxy is not None: Utils.Print("killing web-socket proxy") wsproxy.kill() - TestHelper.shutdown(cluster, walletMgr, testSuccessful=testSuccessful, dumpErrorDetails=dumpErrorDetails) + Utils.Print("killing nodeos") + for node in cluster.nodes: + node.kill(signal.SIGKILL) + if len(cluster.nodes) and cluster.biosNode != cluster.nodes[0]: + cluster.biosNode.kill(signal.SIGKILL) + #TestHelper.shutdown(cluster, walletMgr, testSuccessful=testSuccessful, dumpErrorDetails=dumpErrorDetails) exitCode = 0 if testSuccessful else 1 exit(exitCode) diff --git a/tests/nodeos_eos_evm_test.py b/tests/nodeos_eos_evm_test.py index b1593b3..cd95a75 100755 --- a/tests/nodeos_eos_evm_test.py +++ b/tests/nodeos_eos_evm_test.py @@ -1140,8 +1140,11 @@ def get_block(num): if eosEvmMinerPOpen is not None: Utils.Print("killing evm-miner") eosEvmMinerPOpen.kill() - Utils.Print("shutting down cluster") - TestHelper.shutdown(cluster, walletMgr, testSuccessful=testSuccessful, dumpErrorDetails=dumpErrorDetails) - + Utils.Print("killing nodeos") + for node in cluster.nodes: + node.kill(signal.SIGKILL) + if len(cluster.nodes) and cluster.biosNode != cluster.nodes[0]: + cluster.biosNode.kill(signal.SIGKILL) + exitCode = 0 if testSuccessful else 1 exit(exitCode) diff --git a/tests/nodeos_eos_evm_ws_test_basic.py b/tests/nodeos_eos_evm_ws_test_basic.py index 9786e72..57d0cb4 100755 --- a/tests/nodeos_eos_evm_ws_test_basic.py +++ b/tests/nodeos_eos_evm_ws_test_basic.py @@ -796,7 +796,11 @@ def makeReservedEvmAddress(account): if wsproxy is not None: Utils.Print("killing web-socket proxy") wsproxy.kill() - TestHelper.shutdown(cluster, walletMgr, testSuccessful=testSuccessful, dumpErrorDetails=dumpErrorDetails) - + Utils.Print("killing nodeos") + for node in cluster.nodes: + node.kill(signal.SIGKILL) + if len(cluster.nodes) and cluster.biosNode != cluster.nodes[0]: + cluster.biosNode.kill(signal.SIGKILL) + exitCode = 0 if testSuccessful else 1 exit(exitCode) diff --git a/tests/nodeos_eos_evm_ws_test_fork.py b/tests/nodeos_eos_evm_ws_test_fork.py index 5d8dbf2..682c3c7 100755 --- a/tests/nodeos_eos_evm_ws_test_fork.py +++ b/tests/nodeos_eos_evm_ws_test_fork.py @@ -1104,9 +1104,12 @@ def makeReservedEvmAddress(account): if wsproxy is not None: Utils.Print("killing web-socket proxy") wsproxy.kill() - Utils.Print("shutting down cluster") - TestHelper.shutdown(cluster, walletMgr, testSuccessful=testSuccessful, dumpErrorDetails=dumpErrorDetails) - + Utils.Print("killing nodeos") + for node in cluster.nodes: + node.kill(signal.SIGKILL) + if len(cluster.nodes) and cluster.biosNode != cluster.nodes[0]: + cluster.biosNode.kill(signal.SIGKILL) + Utils.Print("exit eos evm web-socket fork test") exitCode = 0 if testSuccessful else 1 exit(exitCode)