classification
Title: test_socket: NonBlockingTCPTests.testRecv() uses a weak 100 ms sleep as synchronization
Type: Stage: resolved
Components: Tests Versions: Python 3.8, Python 3.7, Python 3.6, Python 2.7
process
Status: closed Resolution: fixed
Dependencies: Superseder:
Assigned To: Nosy List: miss-islington, vstinner
Priority: normal Keywords: patch

Created on 2018-11-29 09:32 by vstinner, last changed 2018-11-30 12:23 by vstinner. This issue is now closed.

Pull Requests
URL Status Linked Edit
PR 10791 merged vstinner, 2018-11-29 09:36
PR 10815 merged miss-islington, 2018-11-30 11:29
PR 10816 merged miss-islington, 2018-11-30 11:29
PR 10817 merged vstinner, 2018-11-30 11:38
PR 10818 merged vstinner, 2018-11-30 11:49
Messages (7)
msg330671 - (view) Author: STINNER Victor (vstinner) * (Python committer) Date: 2018-11-29 09:32
Failure seen on the Windows XP buildbot:

https://buildbot.python.org/all/#/builders/45/builds/288

0:02:14 [ 35/404/1] test_socket failed
test test_socket failed -- Traceback (most recent call last):
  File "d:\cygwin\home\db3l\buildarea\2.7.bolen-windows\build\lib\test\test_socket.py", line 1020, in testRecv
    self.fail("Error trying to do non-blocking recv.")
AssertionError: Error trying to do non-blocking recv.

In fact, the master branch still uses the weak 100 ms sleep as synchronization primitive :-(

Attached PR replaces time.sleep() with a threading.Event().
msg330773 - (view) Author: STINNER Victor (vstinner) * (Python committer) Date: 2018-11-30 11:29
New changeset ebd5d6d6e6e4e751ba9c7534004aadfc27ba9265 by Victor Stinner in branch 'master':
bpo-35347: Fix test_socket.NonBlockingTCPTests (GH-10791)
https://github.com/python/cpython/commit/ebd5d6d6e6e4e751ba9c7534004aadfc27ba9265
msg330774 - (view) Author: miss-islington (miss-islington) Date: 2018-11-30 11:48
New changeset 365f21c2d3756a6768c5b0d479aaf5c2a568b80b by Miss Islington (bot) in branch '3.7':
bpo-35347: Fix test_socket.NonBlockingTCPTests (GH-10791)
https://github.com/python/cpython/commit/365f21c2d3756a6768c5b0d479aaf5c2a568b80b
msg330775 - (view) Author: miss-islington (miss-islington) Date: 2018-11-30 11:51
New changeset af7e81f71858519de8d2bafcb38fce8cca86aa0a by Miss Islington (bot) in branch '3.6':
bpo-35347: Fix test_socket.NonBlockingTCPTests (GH-10791)
https://github.com/python/cpython/commit/af7e81f71858519de8d2bafcb38fce8cca86aa0a
msg330778 - (view) Author: STINNER Victor (vstinner) * (Python committer) Date: 2018-11-30 12:02
New changeset dab59fa56054d6c0f75ae7013337f7baaa248076 by Victor Stinner in branch '2.7':
bpo-35347: Fix test_socket.NonBlockingTCPTests (GH-10791) (GH-10817)
https://github.com/python/cpython/commit/dab59fa56054d6c0f75ae7013337f7baaa248076
msg330781 - (view) Author: STINNER Victor (vstinner) * (Python committer) Date: 2018-11-30 12:22
New changeset 304315d251dbb4e85dd86056ba1925f25e646ca1 by Victor Stinner in branch 'master':
bpo-35347: Cleanup test_socket.NonBlockingTCPTests (GH-10818)
https://github.com/python/cpython/commit/304315d251dbb4e85dd86056ba1925f25e646ca1
msg330782 - (view) Author: STINNER Victor (vstinner) * (Python committer) Date: 2018-11-30 12:23
Ok, test_socket should depend a little bit less on time now ;-)
History
Date User Action Args
2018-11-30 12:23:15vstinnersetstatus: open -> closed
resolution: fixed
messages: + msg330782

stage: patch review -> resolved
2018-11-30 12:22:47vstinnersetmessages: + msg330781
2018-11-30 12:02:44vstinnersetmessages: + msg330778
2018-11-30 11:51:45miss-islingtonsetmessages: + msg330775
2018-11-30 11:49:00vstinnersetpull_requests: + pull_request10062
2018-11-30 11:48:19miss-islingtonsetnosy: + miss-islington
messages: + msg330774
2018-11-30 11:38:21vstinnersetpull_requests: + pull_request10061
2018-11-30 11:29:57miss-islingtonsetpull_requests: + pull_request10060
2018-11-30 11:29:45miss-islingtonsetpull_requests: + pull_request10059
2018-11-30 11:29:27vstinnersetmessages: + msg330773
2018-11-29 09:36:19vstinnersetkeywords: + patch
stage: patch review
pull_requests: + pull_request10038
2018-11-29 09:32:02vstinnercreate