summaryrefslogtreecommitdiffstats
path: root/Lib/test
diff options
context:
space:
mode:
authorRichard Oudkerk <shibturn@gmail.com>2013-02-26 13:00:15 (GMT)
committerRichard Oudkerk <shibturn@gmail.com>2013-02-26 13:00:15 (GMT)
commit5b8a3242c41a66e4853449bbf52cba667ce4bbe9 (patch)
tree73ce8643ec73d2432aa572fc3511248abd169846 /Lib/test
parent514f056a89a624e4d11dfa5a0e1c0fdb4d820a79 (diff)
parent7aaa1ef8580660eb6ba94a48ffaf76acbc75a8a6 (diff)
downloadcpython-5b8a3242c41a66e4853449bbf52cba667ce4bbe9.zip
cpython-5b8a3242c41a66e4853449bbf52cba667ce4bbe9.tar.gz
cpython-5b8a3242c41a66e4853449bbf52cba667ce4bbe9.tar.bz2
Merge
Diffstat (limited to 'Lib/test')
-rw-r--r--Lib/test/test_multiprocessing.py32
1 files changed, 32 insertions, 0 deletions
diff --git a/Lib/test/test_multiprocessing.py b/Lib/test/test_multiprocessing.py
index c38b314..3fb07f6 100644
--- a/Lib/test/test_multiprocessing.py
+++ b/Lib/test/test_multiprocessing.py
@@ -2894,6 +2894,38 @@ class _TestLogging(BaseTestCase):
# assert self.__handled
#
+# Check that Process.join() retries if os.waitpid() fails with EINTR
+#
+
+class _TestPollEintr(BaseTestCase):
+
+ ALLOWED_TYPES = ('processes',)
+
+ @classmethod
+ def _killer(cls, pid):
+ time.sleep(0.5)
+ os.kill(pid, signal.SIGUSR1)
+
+ @unittest.skipUnless(hasattr(signal, 'SIGUSR1'), 'requires SIGUSR1')
+ def test_poll_eintr(self):
+ got_signal = [False]
+ def record(*args):
+ got_signal[0] = True
+ pid = os.getpid()
+ oldhandler = signal.signal(signal.SIGUSR1, record)
+ try:
+ killer = self.Process(target=self._killer, args=(pid,))
+ killer.start()
+ p = self.Process(target=time.sleep, args=(1,))
+ p.start()
+ p.join()
+ self.assertTrue(got_signal[0])
+ self.assertEqual(p.exitcode, 0)
+ killer.join()
+ finally:
+ signal.signal(signal.SIGUSR1, oldhandler)
+
+#
# Test to verify handle verification, see issue 3321
#