Removed tor for travis and stem from requirement.txt and worked on the process killing issue
This commit is contained in:
parent
2dfc120eea
commit
ec035c4f9d
|
@ -7,7 +7,6 @@ addons:
|
||||||
- build-essential
|
- build-essential
|
||||||
- libcap-dev
|
- libcap-dev
|
||||||
- python-qt4
|
- python-qt4
|
||||||
- tor
|
|
||||||
- xvfb
|
- xvfb
|
||||||
install:
|
install:
|
||||||
- pip install -r requirements.txt
|
- pip install -r requirements.txt
|
||||||
|
|
|
@ -6,5 +6,4 @@ fabric-virtualenv
|
||||||
httplib2
|
httplib2
|
||||||
urllib3
|
urllib3
|
||||||
pythondialog
|
pythondialog
|
||||||
stem
|
|
||||||
Pillow
|
Pillow
|
|
@ -23,6 +23,7 @@ import traceback
|
||||||
from struct import pack
|
from struct import pack
|
||||||
|
|
||||||
try:
|
try:
|
||||||
|
print('222222222222222trybitmessagemain testing for the bitmessgemain')
|
||||||
import defaults
|
import defaults
|
||||||
import depends
|
import depends
|
||||||
import shared
|
import shared
|
||||||
|
@ -49,6 +50,7 @@ try:
|
||||||
from helper_test import TestCoreDummy
|
from helper_test import TestCoreDummy
|
||||||
|
|
||||||
except ModuleNotFoundError:
|
except ModuleNotFoundError:
|
||||||
|
print('333333333333block except bitmessagemain testing for the bitmessgemain')
|
||||||
from pybitmessage import defaults
|
from pybitmessage import defaults
|
||||||
from pybitmessage import depends
|
from pybitmessage import depends
|
||||||
from pybitmessage import shared
|
from pybitmessage import shared
|
||||||
|
@ -75,6 +77,7 @@ except ModuleNotFoundError:
|
||||||
addressGenerator, objectProcessor, singleCleaner,
|
addressGenerator, objectProcessor, singleCleaner,
|
||||||
singleWorker, sqlThread)
|
singleWorker, sqlThread)
|
||||||
from pybitmessage.helper_test import TestCoreDummy
|
from pybitmessage.helper_test import TestCoreDummy
|
||||||
|
print('44444444444444444444444444444444444')
|
||||||
|
|
||||||
app_dir = os.path.dirname(os.path.abspath(__file__))
|
app_dir = os.path.dirname(os.path.abspath(__file__))
|
||||||
os.chdir(app_dir)
|
os.chdir(app_dir)
|
||||||
|
@ -164,6 +167,15 @@ def signal_handler(signum, frame):
|
||||||
logger.error("Got signal %i", signum)
|
logger.error("Got signal %i", signum)
|
||||||
# there are possible non-UI variants to run bitmessage
|
# there are possible non-UI variants to run bitmessage
|
||||||
# which should shutdown especially test-mode
|
# 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:
|
if state.thisapp.daemon or not state.enableGUI or state.testmode:
|
||||||
shutdown.doCleanShutdown()
|
shutdown.doCleanShutdown()
|
||||||
else:
|
else:
|
||||||
|
|
|
@ -31,6 +31,9 @@ def doCleanShutdown():
|
||||||
"""
|
"""
|
||||||
Used to tell all the treads to finish work and exit.
|
Used to tell all the treads to finish work and exit.
|
||||||
"""
|
"""
|
||||||
|
logger.error('***********************')
|
||||||
|
logger.error('doCleanShutdown are successfully killed')
|
||||||
|
logger.error('***********************')
|
||||||
state.shutdown = 1
|
state.shutdown = 1
|
||||||
|
|
||||||
objectProcessorQueue.put(('checkShutdownVariable', 'no data'))
|
objectProcessorQueue.put(('checkShutdownVariable', 'no data'))
|
||||||
|
@ -100,5 +103,8 @@ def doCleanShutdown():
|
||||||
os._exit(0) # pylint: disable=protected-access
|
os._exit(0) # pylint: disable=protected-access
|
||||||
except AttributeError:
|
except AttributeError:
|
||||||
logger.info('Core shutdown complete.')
|
logger.info('Core shutdown complete.')
|
||||||
|
logger.error('777777777777777777777')
|
||||||
|
logger.error(len(threading.enumerate()))
|
||||||
|
logger.error('777777777777777777777')
|
||||||
for thread in threading.enumerate():
|
for thread in threading.enumerate():
|
||||||
logger.debug('Thread %s still running', thread.name)
|
logger.error('Thread %s still running', thread.name)
|
||||||
|
|
|
@ -14,6 +14,8 @@ try:
|
||||||
except ModuleNotFoundError:
|
except ModuleNotFoundError:
|
||||||
pass
|
pass
|
||||||
|
|
||||||
|
from pybitmessage.debug import logger
|
||||||
|
|
||||||
|
|
||||||
def put_signal_file(path, filename):
|
def put_signal_file(path, filename):
|
||||||
"""Creates file, presence of which is a signal about some event."""
|
"""Creates file, presence of which is a signal about some event."""
|
||||||
|
@ -35,7 +37,7 @@ class TestProcessProto(unittest.TestCase):
|
||||||
@classmethod
|
@classmethod
|
||||||
def setUpClass(cls):
|
def setUpClass(cls):
|
||||||
"""Setup environment and start pybitmessage"""
|
"""Setup environment and start pybitmessage"""
|
||||||
|
logger.error('Hello I am the setupClass')
|
||||||
cls.home = os.environ['BITMESSAGE_HOME'] = tempfile.gettempdir()
|
cls.home = os.environ['BITMESSAGE_HOME'] = tempfile.gettempdir()
|
||||||
put_signal_file(cls.home, 'unittest.lock')
|
put_signal_file(cls.home, 'unittest.lock')
|
||||||
subprocess.call(cls._process_cmd) # nosec
|
subprocess.call(cls._process_cmd) # nosec
|
||||||
|
@ -56,6 +58,16 @@ class TestProcessProto(unittest.TestCase):
|
||||||
cls.process.send_signal(signal.SIGTERM)
|
cls.process.send_signal(signal.SIGTERM)
|
||||||
try:
|
try:
|
||||||
cls.process.wait(timeout)
|
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:
|
except psutil.TimeoutExpired:
|
||||||
return False
|
return False
|
||||||
return True
|
return True
|
||||||
|
@ -72,8 +84,12 @@ class TestProcessProto(unittest.TestCase):
|
||||||
def tearDownClass(cls):
|
def tearDownClass(cls):
|
||||||
"""Ensures that pybitmessage stopped and removes files"""
|
"""Ensures that pybitmessage stopped and removes files"""
|
||||||
try:
|
try:
|
||||||
|
print('is ever called tearDownC')
|
||||||
if not cls._stop_process():
|
if not cls._stop_process():
|
||||||
cls.process.kill()
|
cls.process.kill()
|
||||||
|
logger.error('***********************')
|
||||||
|
logger.error('tearDownClass are successfully killed')
|
||||||
|
logger.error('***********************')
|
||||||
except (psutil.NoSuchProcess, FileNotFoundError, AttributeError) as e:
|
except (psutil.NoSuchProcess, FileNotFoundError, AttributeError) as e:
|
||||||
pass
|
pass
|
||||||
finally:
|
finally:
|
||||||
|
|
Reference in New Issue
Block a user