Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions changelog/68927.fixed.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
- Fix logging in potentially dead process in reap_stray_processes fixture
14 changes: 9 additions & 5 deletions tests/support/pytest/helpers.py
Original file line number Diff line number Diff line change
Expand Up @@ -895,11 +895,15 @@ def on_terminate(proc):
if alive:
# Give up
for child in alive:
log.warning(
"Process %s survived SIGKILL, giving up:\n%s",
child,
pprint.pformat(child.as_dict()),
)
try:
log.warning(
"Process %s survived SIGKILL, giving up:\n%s",
child,
pprint.pformat(child.as_dict()),
)
except psutil.NoSuchProcess:
# Process killed between the alive check and the log statement
continue


# Only allow star importing the functions defined in this module
Expand Down
Loading