FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

[3.11] gh-110033: Fix signal test_interprocess_signal() (GH-110035) by miss-islington · Pull Request #110041 · python/cpython · GitHub

/ cpython Public
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension .py  (1) .rst  (1) All 2 file types selected
Viewed files
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Unified
Split
Hide whitespace
Diff view
Unified
Split
Hide whitespace
8 changes: 8 additions & 0 deletions Lib/test/signalinterproctester.py
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import gc
import os
import signal
import subprocess
Expand Down Expand Up @@ -60,6 +61,13 @@ def test_interprocess_signal(self):
self.assertEqual(self.got_signals, {'SIGHUP': 1, 'SIGUSR1': 0,
'SIGALRM': 0})

# gh-110033: Make sure that the subprocess.Popen is deleted before
# the next test which raises an exception. Otherwise, the exception
# may be raised when Popen.__del__() is executed and so be logged
# as "Exception ignored in: <function Popen.__del__ at ...>".
child = None
gc.collect()

with self.assertRaises(SIGUSR1Exception):
with self.subprocess_send_signal(pid, "SIGUSR1") as child:
self.wait_signal(child, 'SIGUSR1')
Expand Down
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
Fix ``test_interprocess_signal()`` of ``test_signal``. Make sure that the
``subprocess.Popen`` object is deleted before the test raising an exception
in a signal handler. Otherwise, ``Popen.__del__()`` can get the exception
which is logged as ``Exception ignored in: ...`` and the test fails. Patch by
Victor Stinner.

Back | FazBrowse Home | New Git URL