From 350ec4416f6a174e09bb7cc964548e67c433d288 Mon Sep 17 00:00:00 2001 From: navjot Date: Tue, 29 Sep 2020 17:01:30 +0530 Subject: [PATCH] Stuck forever in apiTest on MainProcess terminating --- src/bitmessagemain.py | 23 ++++++++++++++++------- src/helper_test.py | 10 ++++++++++ 2 files changed, 26 insertions(+), 7 deletions(-) create mode 100644 src/helper_test.py diff --git a/src/bitmessagemain.py b/src/bitmessagemain.py index a0a6a025..350b7571 100755 --- a/src/bitmessagemain.py +++ b/src/bitmessagemain.py @@ -51,6 +51,7 @@ from singleinstance import singleinstance from threads import ( set_thread_name, printLock, addressGenerator, objectProcessor, singleCleaner, singleWorker, sqlThread) +from helper_test import TestCoreDummy def _fixSocket(): @@ -369,14 +370,22 @@ class Main(object): and time.time() - state.last_api_response >= 30 ): self.stop() - elif not state.enableGUI: + else: state.enableGUI = True # pylint: disable=relative-import - from tests import core as test_core - test_core_result = test_core.run() - state.enableGUI = True - self.stop() - test_core.cleanup() + test_core_result = TestCoreDummy(errors = 1,failures = 1) + try: + from tests import core as test_core + test_core_result = test_core.run() + except: + pass + finally: + state.enableGUI = True + self.stop() + try: + test_core.cleanup() + except: + pass sys.exit( 'Core tests failed!' if test_core_result.errors or test_core_result.failures @@ -489,4 +498,4 @@ if __name__ == "__main__": # So far, the creation of and management of the Bitmessage protocol and this # client is a one-man operation. Bitcoin tips are quite appreciated. -# 1H5XaDA6fYENLbknwZyjiYXYPQaFjjLX2u +# 1H5XaDA6fYENLbknwZyjiYXYPQaFjjLX2u \ No newline at end of file diff --git a/src/helper_test.py b/src/helper_test.py new file mode 100644 index 00000000..b8041564 --- /dev/null +++ b/src/helper_test.py @@ -0,0 +1,10 @@ +""" +src/helper_test.py +================================= +""" +import collections + +""" +Core Dummy testcase instance +""" +TestCoreDummy = collections.namedtuple('TestCoreDummy',['errors','failures']) \ No newline at end of file