New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Race condition in test_socket #80304
Comments
Looking at the buildbot failures, there is a race condition in a test_socket test: def _testWithTimeoutTriggeredSend(self):
address = self.serv.getsockname()
with open(support.TESTFN, 'rb') as file:
with socket.create_connection(address, timeout=0.01) as sock:
meth = self.meth_from_sock(sock)
self.assertRaises(socket.timeout, meth, file)
def testWithTimeoutTriggeredSend(self):
conn = self.accept_conn()
conn.recv(88192) on slow buildbot, create_connection() fails with a timeout exception sometimes because the server fails to start listing in less than 10 ms. https://buildbot.python.org/all/#/builders/167/builds/597 ====================================================================== Traceback (most recent call last):
File "/usr/home/buildbot/python/3.x.koobs-freebsd10.nondebug/build/Lib/test/test_socket.py",
line 5796, in testWithTimeoutTriggeredSend
conn = self.accept_conn()
File "/usr/home/buildbot/python/3.x.koobs-freebsd10.nondebug/build/Lib/test/test_socket.py",
line 5607, in accept_conn
conn, addr = self.serv.accept()
File "/usr/home/buildbot/python/3.x.koobs-freebsd10.nondebug/build/Lib/socket.py",
line 212, in accept
fd, addr = self._accept()
socket.timeout: timed out ====================================================================== Traceback (most recent call last):
File "/usr/home/buildbot/python/3.x.koobs-freebsd10.nondebug/build/Lib/test/test_socket.py",
line 335, in _tearDown
raise exc
File "/usr/home/buildbot/python/3.x.koobs-freebsd10.nondebug/build/Lib/test/test_socket.py",
line 353, in clientRun
test_func()
File "/usr/home/buildbot/python/3.x.koobs-freebsd10.nondebug/build/Lib/test/test_socket.py",
line 5791, in _testWithTimeoutTriggeredSend
with socket.create_connection(address, timeout=0.01) as sock:
File "/usr/home/buildbot/python/3.x.koobs-freebsd10.nondebug/build/Lib/socket.py",
line 727, in create_connection
raise err
File "/usr/home/buildbot/python/3.x.koobs-freebsd10.nondebug/build/Lib/socket.py",
line 716, in create_connection
sock.connect(sa)
socket.timeout: timed out Note: Reported my Victor. I created the bug to track. |
I am closing this as it has been fixed by this PR <https://github.com/python/cpython/pull/12053\> |
Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.
Show more details
GitHub fields:
bugs.python.org fields:
The text was updated successfully, but these errors were encountered: