This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author steve.dower
Recipients pitrou, steve.dower
Date 2015-03-15.04:23:47
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1426393428.29.0.286141594262.issue23669@psf.upfronthosting.co.za>
In-reply-to
Content
The test at Lib/test/test_socket.py:3883 is failing intermittently (but more often than not) due to a race condition between the two threads involved in the test.

======================================================================
FAIL: testRecv (test.test_socket.NonBlockingTCPTests)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "C:\build\cpython\lib\test\test_socket.py", line 3883, in testRecv
    self.fail("Error trying to do non-blocking recv.")
AssertionError: Error trying to do non-blocking recv.

----------------------------------------------------------------------

The message in this case means the recv succeeded when it should have failed due to lack of data. But the second thread just delays briefly before sending data, and apparently the main thread can stall long enough for the data to be available in the first part of the test.

A quick check using an Event rather than the sleep shows that the race condition can be fixed, but it seems like this may affect more tests as a lot seem to involve sleep-based timing.

(I've only seen this on Windows, but I see no reason why it shouldn't affect other platforms as well.)
History
Date User Action Args
2015-03-15 04:23:48steve.dowersetrecipients: + steve.dower, pitrou
2015-03-15 04:23:48steve.dowersetmessageid: <1426393428.29.0.286141594262.issue23669@psf.upfronthosting.co.za>
2015-03-15 04:23:48steve.dowerlinkissue23669 messages
2015-03-15 04:23:47steve.dowercreate