Stuck forever in apiTest on MainProcess terminating

This commit is contained in:
navjot 2020-09-29 17:01:30 +05:30
parent 6b65113bb4
commit 350ec4416f
No known key found for this signature in database
GPG Key ID: 9EE70AFD71357F1C
2 changed files with 26 additions and 7 deletions

View File

@ -51,6 +51,7 @@ from singleinstance import singleinstance
from threads import ( from threads import (
set_thread_name, printLock, set_thread_name, printLock,
addressGenerator, objectProcessor, singleCleaner, singleWorker, sqlThread) addressGenerator, objectProcessor, singleCleaner, singleWorker, sqlThread)
from helper_test import TestCoreDummy
def _fixSocket(): def _fixSocket():
@ -369,14 +370,22 @@ class Main(object):
and time.time() - state.last_api_response >= 30 and time.time() - state.last_api_response >= 30
): ):
self.stop() self.stop()
elif not state.enableGUI: else:
state.enableGUI = True state.enableGUI = True
# pylint: disable=relative-import # pylint: disable=relative-import
test_core_result = TestCoreDummy(errors = 1,failures = 1)
try:
from tests import core as test_core from tests import core as test_core
test_core_result = test_core.run() test_core_result = test_core.run()
except:
pass
finally:
state.enableGUI = True state.enableGUI = True
self.stop() self.stop()
try:
test_core.cleanup() test_core.cleanup()
except:
pass
sys.exit( sys.exit(
'Core tests failed!' 'Core tests failed!'
if test_core_result.errors or test_core_result.failures if test_core_result.errors or test_core_result.failures

10
src/helper_test.py Normal file
View File

@ -0,0 +1,10 @@
"""
src/helper_test.py
=================================
"""
import collections
"""
Core Dummy testcase instance
"""
TestCoreDummy = collections.namedtuple('TestCoreDummy',['errors','failures'])