summaryrefslogtreecommitdiffstats
path: root/Lib/test/_test_multiprocessing.py
diff options
context:
space:
mode:
authorVictor Stinner <vstinner@redhat.com>2018-07-04 09:49:41 (GMT)
committerGitHub <noreply@github.com>2018-07-04 09:49:41 (GMT)
commit07888e1cce89e9bb7dc501e287b4cb126e01c378 (patch)
treee650efede6af8fb070cb67086b4747fdc36d7a9f /Lib/test/_test_multiprocessing.py
parent12a08c47601cadea8e7d3808502cdbcca87b2ce2 (diff)
downloadcpython-07888e1cce89e9bb7dc501e287b4cb126e01c378.zip
cpython-07888e1cce89e9bb7dc501e287b4cb126e01c378.tar.gz
cpython-07888e1cce89e9bb7dc501e287b4cb126e01c378.tar.bz2
bpo-34040, multiprocessing: Fix test_forkserver_sigkill() (GH-8081)
Fix test_forkserver_sigkill() of test_multiprocessing_forkserver: give more time to the first child process to complete, double the sleep in the parent process. Reduce also the child process sleep from 1000 ms to 500 ms, to not change the total duration of the test.
Diffstat (limited to 'Lib/test/_test_multiprocessing.py')
-rw-r--r--Lib/test/_test_multiprocessing.py8
1 files changed, 6 insertions, 2 deletions
diff --git a/Lib/test/_test_multiprocessing.py b/Lib/test/_test_multiprocessing.py
index 4c5da2f..c4810a5 100644
--- a/Lib/test/_test_multiprocessing.py
+++ b/Lib/test/_test_multiprocessing.py
@@ -651,13 +651,17 @@ class _TestProcess(BaseTestCase):
from multiprocessing.forkserver import _forkserver
_forkserver.ensure_running()
+ # First process sleeps 500 ms
+ delay = 0.5
+
evt = self.Event()
- proc = self.Process(target=self._sleep_and_set_event, args=(evt, 1.0))
+ proc = self.Process(target=self._sleep_and_set_event, args=(evt, delay))
proc.start()
pid = _forkserver._forkserver_pid
os.kill(pid, signum)
- time.sleep(1.0) # give it time to die
+ # give time to the fork server to die and time to proc to complete
+ time.sleep(delay * 2.0)
evt2 = self.Event()
proc2 = self.Process(target=self._sleep_and_set_event, args=(evt2,))