Skip to content

Commit

Permalink
GH-1433 Update test for failure case of trace_api_plugin not having t…
Browse files Browse the repository at this point in the history
…ime to deserialize
  • Loading branch information
heifner committed Jul 25, 2023
1 parent 61fe0e5 commit b16135d
Showing 1 changed file with 16 additions and 2 deletions.
18 changes: 16 additions & 2 deletions tests/trace_plugin_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,9 @@
import time
import unittest
import os
import signal

from TestHarness import Cluster, Node, TestHelper, Utils, WalletMgr
from TestHarness import Cluster, Node, TestHelper, Utils, WalletMgr, ReturnType
from core_symbol import CORE_SYMBOL

class TraceApiPluginTest(unittest.TestCase):
Expand All @@ -29,7 +30,7 @@ def cleanEnv(self, shouldCleanup: bool) :
def startEnv(self) :
account_names = ["alice", "bob", "charlie"]
abs_path = os.path.abspath(os.getcwd() + '/unittests/contracts/eosio.token/eosio.token.abi')
traceNodeosArgs = " --trace-rpc-abi eosio.token=" + abs_path
traceNodeosArgs = " --verbose-http-errors --trace-rpc-abi eosio.token=" + abs_path
self.cluster.launch(totalNodes=1, extraNodeosArgs=traceNodeosArgs)
self.walletMgr.launch()
testWalletName="testwallet"
Expand Down Expand Up @@ -102,6 +103,19 @@ def test_TraceApi(self) :
break
self.assertTrue(isTrxInBlockFromTraceApi)

# relaunch with no time allocated for http response & abi-serializer so should always fail
node.kill(signal.SIGTERM)
Utils.Print("Ignore expected: ERROR: Node relaunch Failed")
isRelaunchSuccess = node.relaunch(addSwapFlags={"--http-max-response-time-ms": "0", "--abi-serializer-max-time-ms": "10"})

cmdDesc="get block_trace"
cmd=" --print-response %s %d" % (cmdDesc, blockNum)
cmd="%s %s %s" % (Utils.EosClientPath, node.eosClientArgs(), cmd)
result=Utils.runCmdReturnStr(cmd, ignoreError=True)

Utils.Print(f"{cmdDesc} returned: {result}")
self.assertIn("Internal Server Error", result)

@classmethod
def setUpClass(self):
self.cleanEnv(self, shouldCleanup=True)
Expand Down

0 comments on commit b16135d

Please sign in to comment.