From 09d5b42b9a774ef885ddccea40028af3c4c95881 Mon Sep 17 00:00:00 2001 From: Clayton Calabrese Date: Tue, 12 Jul 2022 10:04:25 -0500 Subject: [PATCH 1/2] force the plugin_http_api_test to use a custom config dir so it doesn't see a rare failure case. --- tests/plugin_http_api_test.py | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/tests/plugin_http_api_test.py b/tests/plugin_http_api_test.py index f10ab94773..00843c9279 100755 --- a/tests/plugin_http_api_test.py +++ b/tests/plugin_http_api_test.py @@ -19,6 +19,7 @@ class PluginHttpTest(unittest.TestCase): node_id = 1 nodeos = Node(TestHelper.LOCAL_HOST, TestHelper.DEFAULT_PORT, node_id, walletMgr=keosd) data_dir = Utils.getNodeDataDir(node_id) + config_dir = Utils.getNodeConfigDir(node_id) http_post_str = " -X POST -d " http_post_invalid_param = " '{invalid}' " empty_content_str = " ' { } ' " @@ -31,13 +32,21 @@ def createDataDir(self): shutil.rmtree(self.data_dir) os.makedirs(self.data_dir) - # kill nodeos and keosd and clean up dir + # make a fresh config dir + def createConfigDir(self): + if os.path.exists(self.config_dir): + shutil.rmtree(self.config_dir) + os.makedirs(self.config_dir) + + # kill nodeos and keosd and clean up dirs def cleanEnv(self) : self.keosd.killall(True) WalletMgr.cleanup() Node.killAllNodeos() if os.path.exists(self.data_dir): shutil.rmtree(self.data_dir) + if os.path.exists(self.config_dir): + shutil.rmtree(self.config_dir) time.sleep(self.sleep_s) # start keosd and nodeos From 92a49646dcf9ffdd819f6a6eedfcf186d4c1eed0 Mon Sep 17 00:00:00 2001 From: Clayton Calabrese Date: Tue, 12 Jul 2022 11:53:20 -0500 Subject: [PATCH 2/2] use config dir in plugin_http_api_test --- tests/plugin_http_api_test.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/tests/plugin_http_api_test.py b/tests/plugin_http_api_test.py index 00843c9279..c7b8e94d13 100755 --- a/tests/plugin_http_api_test.py +++ b/tests/plugin_http_api_test.py @@ -52,6 +52,7 @@ def cleanEnv(self) : # start keosd and nodeos def startEnv(self) : self.createDataDir(self) + self.createConfigDir(self) self.keosd.launch() nodeos_plugins = (" --plugin %s --plugin %s --plugin %s --plugin %s --plugin %s --plugin %s" " --plugin %s --plugin %s --plugin %s --plugin %s ") % ( "eosio::trace_api_plugin", @@ -64,9 +65,9 @@ def startEnv(self) : "eosio::chain_api_plugin", "eosio::http_plugin", "eosio::db_size_api_plugin") - nodeos_flags = (" --data-dir=%s --trace-dir=%s --trace-no-abis --access-control-allow-origin=%s " + nodeos_flags = (" --data-dir=%s --config-dir=%s --trace-dir=%s --trace-no-abis --access-control-allow-origin=%s " "--contracts-console --http-validate-host=%s --verbose-http-errors " - "--p2p-peer-address localhost:9011 --resource-monitor-not-shutdown-on-threshold-exceeded ") % (self.data_dir, self.data_dir, "\'*\'", "false") + "--p2p-peer-address localhost:9011 --resource-monitor-not-shutdown-on-threshold-exceeded ") % (self.data_dir, self.config_dir, self.data_dir, "\'*\'", "false") start_nodeos_cmd = ("%s -e -p eosio %s %s ") % (Utils.EosServerPath, nodeos_plugins, nodeos_flags) self.nodeos.launchCmd(start_nodeos_cmd, self.node_id) time.sleep(self.sleep_s)