Skip to content

Commit c07b384

Browse files
author
HAMON GPT-6 worker
committed
gh-161408: Remove ineffective descriptor leak test
1 parent 962ed51 commit c07b384

1 file changed

Lines changed: 0 additions & 30 deletions

File tree

‎Lib/test/_test_multiprocessing.py‎

Lines changed: 0 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -6324,36 +6324,6 @@ def test_passed_fds_are_not_inheritable(self):
63246324
writer.close()
63256325
reader.close()
63266326

6327-
@staticmethod
6328-
def _test_exec_grandchild(conn):
6329-
grandchild = subprocess.Popen(
6330-
[sys.executable, '-c', 'import time; time.sleep(30)'],
6331-
stdin=subprocess.DEVNULL, stdout=subprocess.DEVNULL,
6332-
stderr=subprocess.DEVNULL, close_fds=False)
6333-
conn.send(grandchild.pid)
6334-
6335-
@unittest.skipIf(WIN32, "POSIX file descriptors only")
6336-
@only_run_in_spawn_testsuite("spawn sentinel file descriptor")
6337-
def test_spawn_sentinel_does_not_leak_to_exec(self):
6338-
reader, writer = multiprocessing.Pipe(duplex=False)
6339-
grandchild_pid = None
6340-
p = multiprocessing.Process(target=self._test_exec_grandchild,
6341-
args=(writer,))
6342-
try:
6343-
p.start()
6344-
writer.close()
6345-
grandchild_pid = reader.recv()
6346-
p.join(timeout=2)
6347-
self.assertEqual(p.exitcode, 0)
6348-
finally:
6349-
if grandchild_pid is not None:
6350-
try:
6351-
os.kill(grandchild_pid, signal.SIGTERM)
6352-
except ProcessLookupError:
6353-
pass
6354-
p.join(timeout=support.SHORT_TIMEOUT)
6355-
writer.close()
6356-
reader.close()
63576327

63586328
#
63596329
# Issue #17097: EINTR should be ignored by recv(), send(), accept() etc

0 commit comments

Comments
 (0)