Skip to content

Commit 133bb60

Browse files
Tanmay DasPrabhakar Kumar
authored andcommitted
Bugfix: Pass test_get_child_processes even with NoSuchProcess error
1 parent 5e69c42 commit 133bb60

File tree

1 file changed

+5
-9
lines changed

1 file changed

+5
-9
lines changed

tests/util/test_util.py

Lines changed: 5 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -69,12 +69,8 @@ async def test_get_child_processes(loop):
6969
children[0].terminate()
7070
children[0].wait()
7171

72-
except psutil.NoSuchProcess as e:
73-
# Only in windows, occasionally psutil.NoSuchProcess is raised.
74-
if system.is_windows():
75-
pass
76-
else:
77-
raise e
78-
79-
except Exception as e:
80-
raise e
72+
except psutil.NoSuchProcess:
73+
# occasionally psutil.NoSuchProcess is raised while terminating the child process
74+
# when the parent process is already terminated. Since all the processes launched
75+
# by the test are already terminated, so we may pass the test even with this error
76+
pass

0 commit comments

Comments
 (0)