Added psutil's wait process condition on the tearDownClass method
This commit is contained in:
parent
14b6202923
commit
978d8cfa07
|
@ -100,10 +100,17 @@ class TestProcessProto(unittest.TestCase):
|
||||||
print('is ever called tearDownC')
|
print('is ever called tearDownC')
|
||||||
if not cls._stop_process():
|
if not cls._stop_process():
|
||||||
cls.process.kill()
|
cls.process.kill()
|
||||||
logger.error('***********************')
|
gone, alive = psutil.wait_procs(cls.process, timeout = 3,
|
||||||
logger.error('tearDownClass are successfully killed')
|
callback = None)
|
||||||
logger.error('***********************')
|
for p in alive:
|
||||||
|
p.kill()
|
||||||
|
print('***********************')
|
||||||
|
print('tearDownClass are successfully killed')
|
||||||
|
print('***********************')
|
||||||
except (psutil.NoSuchProcess, FileNotFoundError, AttributeError) as e:
|
except (psutil.NoSuchProcess, FileNotFoundError, AttributeError) as e:
|
||||||
|
print('################################')
|
||||||
|
print('TearDownClass except section')
|
||||||
|
print('################################')
|
||||||
pass
|
pass
|
||||||
finally:
|
finally:
|
||||||
cls._cleanup_files()
|
cls._cleanup_files()
|
||||||
|
|
Reference in New Issue
Block a user