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

gh-157184: Scale the join() alarm in the multiprocessing kill tests by iamsharduld · Pull Request #157185 · python/cpython · GitHub

Repository navigation

Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension .py  (1) All 1 file type 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
6 changes: 5 additions & 1 deletion Lib/test/_test_multiprocessing.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
Expand Up @@ -9,6 +9,7 @@
import time
import io
import itertools
import math
import sys
import os
import gc
Expand Down Expand Up @@ -624,11 +625,14 @@ def _kill_process(self, meth, target=None):
if hasattr(signal, 'alarm'):
# On the Gentoo buildbot waitpid() often seems to block forever.
# We use alarm() to interrupt it if it blocks for too long.
# The timeout only has to catch a hang, so use LONG_TIMEOUT:
# a shorter one fires on a slow build where reaping the child
# legitimately takes a while.
def handler(*args):
raise RuntimeError('join took too long: %s' % p)
old_handler = signal.signal(signal.SIGALRM, handler)
try:
signal.alarm(10)
signal.alarm(math.ceil(support.LONG_TIMEOUT))
self.assertEqual(join(), None)
finally:
signal.alarm(0)
Expand Down
Loading

Back | FazBrowse Home | New Git URL