Issue 32090: test_put() of test_multiprocessing queue tests has a race condition (original) (raw)

The test failed on AMD64 FreeBSD 10.x Shared 3.x:

http://buildbot.python.org/all/#/builders/87/builds/200/steps/4/logs/stdio

FAIL: test_put (test.test_multiprocessing_fork.WithProcessesTestQueue)

Traceback (most recent call last): File "/usr/home/buildbot/python/3.x.koobs-freebsd10/build/Lib/test/_test_multiprocessing.py", line 809, in test_put self.assertEqual(queue_empty(queue), False) AssertionError: True != False

--

I succeeded to reproduce the issue on Linux with this change:

diff --git a/Lib/test/_test_multiprocessing.py b/Lib/test/_test_multiprocessing.py index dbca2d89ed..0754ac0d52 100644 --- a/Lib/test/_test_multiprocessing.py +++ b/Lib/test/_test_multiprocessing.py @@ -804,7 +804,7 @@ class _TestQueue(BaseTestCase): queue.put_nowait(6)

     # the values may be in buffer but not yet in pipe so sleep a bit