[Python-checkins] cpython: Stop trying to use strace, but add a sleep before terminate().
richard.oudkerk
python-checkins at python.org
Thu Oct 17 14:57:51 CEST 2013
http://hg.python.org/cpython/rev/4e2b08c78b3d
changeset: 86398:4e2b08c78b3d
user: Richard Oudkerk <shibturn at gmail.com>
date: Thu Oct 17 13:56:18 2013 +0100
summary:
Stop trying to use strace, but add a sleep before terminate().
files:
Lib/test/_test_multiprocessing.py | 12 ++++--------
1 files changed, 4 insertions(+), 8 deletions(-)
diff --git a/Lib/test/_test_multiprocessing.py b/Lib/test/_test_multiprocessing.py
--- a/Lib/test/_test_multiprocessing.py
+++ b/Lib/test/_test_multiprocessing.py
@@ -300,12 +300,14 @@
self.assertTimingAlmostEqual(join.elapsed, 0.0)
self.assertEqual(p.is_alive(), True)
+ # XXX maybe terminating too soon causes the problems on Gentoo...
+ time.sleep(1)
+
p.terminate()
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, and
- # then try to print a backtrace for the child process using gdb.
+ # We use alarm() to interrupt it if it blocks for too long.
def handler(*args):
raise RuntimeError('join took too long: %s' % p)
old_handler = signal.signal(signal.SIGALRM, handler)
@@ -315,12 +317,6 @@
signal.alarm(0)
except RuntimeError:
print('os.waitpid() =', os.waitpid(p.pid, os.WNOHANG))
- import subprocess
- try:
- subprocess.check_call(['strace', '-p', str(p.pid)],
- timeout=10)
- except subprocess.TimeoutExpired:
- pass
raise
finally:
signal.signal(signal.SIGALRM, old_handler)
--
Repository URL: http://hg.python.org/cpython
More information about the Python-checkins
mailing list