]> granicus.if.org Git - python/commitdiff
Stop trying to use strace, but add a sleep before terminate().
authorRichard Oudkerk <shibturn@gmail.com>
Thu, 17 Oct 2013 12:56:18 +0000 (13:56 +0100)
committerRichard Oudkerk <shibturn@gmail.com>
Thu, 17 Oct 2013 12:56:18 +0000 (13:56 +0100)
Lib/test/_test_multiprocessing.py

index d2b9403680cc5d9d2d1bcc1500c6bfef9c3a0806..daf53194114b7f9cdba7a7d933ceb84bda504a1e 100644 (file)
@@ -300,12 +300,14 @@ class _TestProcess(BaseTestCase):
         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 @@ class _TestProcess(BaseTestCase):
                 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)