Removed tor for travis and stem from requirement.txt and worked on the process killing issue

This commit is contained in:
jai.s 2020-10-08 20:08:46 +05:30
parent 2dfc120eea
commit ec035c4f9d
No known key found for this signature in database
GPG Key ID: 360CFA25EFC67D12
5 changed files with 36 additions and 4 deletions

View File

@ -7,7 +7,6 @@ addons:
- build-essential
- libcap-dev
- python-qt4
- tor
- xvfb
install:
- pip install -r requirements.txt

View File

@ -6,5 +6,4 @@ fabric-virtualenv
httplib2
urllib3
pythondialog
stem
Pillow

View File

@ -23,6 +23,7 @@ import traceback
from struct import pack
try:
print('222222222222222trybitmessagemain testing for the bitmessgemain')
import defaults
import depends
import shared
@ -49,6 +50,7 @@ try:
from helper_test import TestCoreDummy
except ModuleNotFoundError:
print('333333333333block except bitmessagemain testing for the bitmessgemain')
from pybitmessage import defaults
from pybitmessage import depends
from pybitmessage import shared
@ -75,6 +77,7 @@ except ModuleNotFoundError:
addressGenerator, objectProcessor, singleCleaner,
singleWorker, sqlThread)
from pybitmessage.helper_test import TestCoreDummy
print('44444444444444444444444444444444444')
app_dir = os.path.dirname(os.path.abspath(__file__))
os.chdir(app_dir)
@ -164,6 +167,15 @@ def signal_handler(signum, frame):
logger.error("Got signal %i", signum)
# there are possible non-UI variants to run bitmessage
# which should shutdown especially test-mode
print('09090909090909090909090909090909090')
import traceback
logger.error(traceback.print_stack())
logger.error('010101010101010101')
logger.error(' inside the bitmessageamain ')
logger.error('state.thisapp.daemon-{}'.format(state.thisapp.daemon))
logger.error('state.enableGUI -{}'.format(state.enableGUI))
logger.error('state.testmode -{}'.format(state.testmode))
logger.error('010101010101010101')
if state.thisapp.daemon or not state.enableGUI or state.testmode:
shutdown.doCleanShutdown()
else:

View File

@ -31,6 +31,9 @@ def doCleanShutdown():
"""
Used to tell all the treads to finish work and exit.
"""
logger.error('***********************')
logger.error('doCleanShutdown are successfully killed')
logger.error('***********************')
state.shutdown = 1
objectProcessorQueue.put(('checkShutdownVariable', 'no data'))
@ -100,5 +103,8 @@ def doCleanShutdown():
os._exit(0) # pylint: disable=protected-access
except AttributeError:
logger.info('Core shutdown complete.')
logger.error('777777777777777777777')
logger.error(len(threading.enumerate()))
logger.error('777777777777777777777')
for thread in threading.enumerate():
logger.debug('Thread %s still running', thread.name)
logger.error('Thread %s still running', thread.name)

View File

@ -14,6 +14,8 @@ try:
except ModuleNotFoundError:
pass
from pybitmessage.debug import logger
def put_signal_file(path, filename):
"""Creates file, presence of which is a signal about some event."""
@ -35,7 +37,7 @@ class TestProcessProto(unittest.TestCase):
@classmethod
def setUpClass(cls):
"""Setup environment and start pybitmessage"""
logger.error('Hello I am the setupClass')
cls.home = os.environ['BITMESSAGE_HOME'] = tempfile.gettempdir()
put_signal_file(cls.home, 'unittest.lock')
subprocess.call(cls._process_cmd) # nosec
@ -56,6 +58,16 @@ class TestProcessProto(unittest.TestCase):
cls.process.send_signal(signal.SIGTERM)
try:
cls.process.wait(timeout)
# import traceback
print('55555555555555555')
import psutil
print('psutil.pid_exists(cls.process.pid)-{}'.format(
psutil.pid_exists(cls.process.pid)))
print('55555555555555555')
# traceback.print_stack()
logger.error('_stop_process')
logger.error('this condition are getting killed are not')
logger.error('__stop__process')
except psutil.TimeoutExpired:
return False
return True
@ -72,8 +84,12 @@ class TestProcessProto(unittest.TestCase):
def tearDownClass(cls):
"""Ensures that pybitmessage stopped and removes files"""
try:
print('is ever called tearDownC')
if not cls._stop_process():
cls.process.kill()
logger.error('***********************')
logger.error('tearDownClass are successfully killed')
logger.error('***********************')
except (psutil.NoSuchProcess, FileNotFoundError, AttributeError) as e:
pass
finally: