[issue36123] Race condition in test_socket

2019-02-26 Thread Joannah Nanjekye


Joannah Nanjekye  added the comment:

I am closing this as it has been fixed by this PR 


--
stage: patch review -> resolved
status: open -> closed

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue36123] Race condition in test_socket

2019-02-26 Thread miss-islington


miss-islington  added the comment:


New changeset 2632474957fa9c6311af21be6906d1234853f288 by Miss Islington (bot) 
in branch '3.7':
bpo-36123: Fix test_socket.testWithTimeoutTriggeredSend() race condition 
(GH-12053)
https://github.com/python/cpython/commit/2632474957fa9c6311af21be6906d1234853f288


--
nosy: +miss-islington

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue36123] Race condition in test_socket

2019-02-26 Thread miss-islington


Change by miss-islington :


--
pull_requests: +12081

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue36123] Race condition in test_socket

2019-02-26 Thread STINNER Victor


STINNER Victor  added the comment:


New changeset 53b9e1a1c1d86187ad6fbee492b697ef8be74205 by Victor Stinner 
(Joannah Nanjekye) in branch 'master':
bpo-36123: Fix test_socket.testWithTimeoutTriggeredSend() race condition 
(GH-12053)
https://github.com/python/cpython/commit/53b9e1a1c1d86187ad6fbee492b697ef8be74205


--
nosy: +vstinner

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue36123] Race condition in test_socket

2019-02-26 Thread Joannah Nanjekye


Change by Joannah Nanjekye :


--
keywords: +patch
pull_requests: +12079
stage:  -> patch review

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue36123] Race condition in test_socket

2019-02-26 Thread Joannah Nanjekye


New submission from Joannah Nanjekye :

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

==
ERROR: testWithTimeoutTriggeredSend (test.test_socket.SendfileUsingSendTest)
--
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

==
ERROR: testWithTimeoutTriggeredSend (test.test_socket.SendfileUsingSendTest)
--
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.

--
components: Tests
messages: 336658
nosy: nanjekyejoannah
priority: normal
severity: normal
status: open
title: Race condition in test_socket
type: behavior
versions: Python 3.8

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com