mirror of
https://github.com/python/cpython.git
synced 2025-07-28 21:55:21 +00:00
Fix the test for SocketServer so it should pass on cygwin and not fail
sporadically on other platforms. This is really a band-aid that doesn't fix the underlying issue in SocketServer. It's not clear if it's worth it to fix SocketServer, however, I opened a bug to track it: http://python.org/sf/1540386
This commit is contained in:
parent
bf8c19536e
commit
b476fdf7c3
2 changed files with 12 additions and 0 deletions
|
@ -181,10 +181,19 @@ else:
|
|||
if hasattr(os, 'fork') and os.name not in ('os2',):
|
||||
dgramservers.append(ForkingUnixDatagramServer)
|
||||
|
||||
def sloppy_cleanup():
|
||||
# See http://python.org/sf/1540386
|
||||
# We need to reap children here otherwise a child from one server
|
||||
# can be left running for the next server and cause a test failure.
|
||||
time.sleep(DELAY)
|
||||
reap_children()
|
||||
|
||||
def testall():
|
||||
testloop(socket.AF_INET, tcpservers, MyStreamHandler, teststream)
|
||||
sloppy_cleanup()
|
||||
testloop(socket.AF_INET, udpservers, MyDatagramHandler, testdgram)
|
||||
if hasattr(socket, 'AF_UNIX'):
|
||||
sloppy_cleanup()
|
||||
testloop(socket.AF_UNIX, streamservers, MyStreamHandler, teststream)
|
||||
# Alas, on Linux (at least) recvfrom() doesn't return a meaningful
|
||||
# client address so this cannot work:
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue