Skip to content

Commit

Permalink
shutdown order fix
Browse files Browse the repository at this point in the history
  • Loading branch information
taokayan committed Sep 20, 2024
1 parent a762416 commit ab17671
Show file tree
Hide file tree
Showing 5 changed files with 55 additions and 49 deletions.
19 changes: 10 additions & 9 deletions tests/nodeos_eos_evm_different_token_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
21 changes: 12 additions & 9 deletions tests/nodeos_eos_evm_gasparam_fork_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
18 changes: 9 additions & 9 deletions tests/nodeos_eos_evm_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
21 changes: 12 additions & 9 deletions tests/nodeos_eos_evm_ws_test_basic.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
25 changes: 12 additions & 13 deletions tests/nodeos_eos_evm_ws_test_fork.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit ab17671

Please sign in to comment.