Author steve.dower
Recipients pitrou, steve.dower
Date 2015-03-15.04:23:47
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <>
The test at Lib/test/ 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\", line 3883, in testRecv"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.)
Date User Action Args
2015-03-15 04:23:48steve.dowersetrecipients: + steve.dower, pitrou
2015-03-15 04:23:48steve.dowersetmessageid: <>
2015-03-15 04:23:48steve.dowerlinkissue23669 messages
2015-03-15 04:23:47steve.dowercreate