Removed extra imported psutil and added try and except block for the psutil pid condition

This commit is contained in:
jai.s 2020-10-09 13:55:52 +05:30
parent 080005d870
commit f2e816d660
No known key found for this signature in database
GPG Key ID: 360CFA25EFC67D12

View File

@ -58,12 +58,14 @@ 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 try:
print('55555555555555555') print('55555555555555555')
import psutil
print('psutil.pid_exists(cls.process.pid)-{}'.format( print('psutil.pid_exists(cls.process.pid)-{}'.format(
psutil.pid_exists(cls.process.pid))) psutil.pid_exists(cls.process.pid)))
print('55555555555555555') print('55555555555555555')
except:
pass
# import traceback
# traceback.print_stack() # traceback.print_stack()
logger.error('_stop_process') logger.error('_stop_process')
logger.error('this condition are getting killed are not') logger.error('this condition are getting killed are not')