sanitycheck: Add exception check
Add exception check for psutil when running CI with nSIM Sometimes nSIM random failures may turn nsimdrv process into zombie process, parent process can't terminate it by calling proc.wait(0.1) and kill command doesn't apply to zombie process Signed-off-by: Jingru Wang <jingru@synopsys.com>
This commit is contained in:
parent
a20b3307c4
commit
f20c15caaf
1 changed files with 4 additions and 1 deletions
|
@ -454,7 +454,10 @@ class BinaryHandler(Handler):
|
|||
# work. Newer ninja's don't seem to pass SIGTERM down to the children
|
||||
# so we need to use try_kill_process_by_pid.
|
||||
for child in psutil.Process(proc.pid).children(recursive=True):
|
||||
os.kill(child.pid, signal.SIGTERM)
|
||||
try:
|
||||
os.kill(child.pid, signal.SIGTERM)
|
||||
except ProcessLookupError:
|
||||
pass
|
||||
proc.terminate()
|
||||
# sleep for a while before attempting to kill
|
||||
time.sleep(0.5)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue