summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorNeal Norwitz <nnorwitz@gmail.com>2006-08-15 04:58:28 (GMT)
committerNeal Norwitz <nnorwitz@gmail.com>2006-08-15 04:58:28 (GMT)
commitb476fdf7c3dba7054f2349b1e4df581ca521591b (patch)
tree0dd0b3f2c3addbbf273e4e6d2a7706c6e694ee6e
parentbf8c19536e6e4a2061b261fb00c27814b8e14fe7 (diff)
downloadcpython-b476fdf7c3dba7054f2349b1e4df581ca521591b.zip
cpython-b476fdf7c3dba7054f2349b1e4df581ca521591b.tar.gz
cpython-b476fdf7c3dba7054f2349b1e4df581ca521591b.tar.bz2
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
-rw-r--r--Lib/test/test_socketserver.py9
-rw-r--r--Misc/NEWS3
2 files changed, 12 insertions, 0 deletions
diff --git a/Lib/test/test_socketserver.py b/Lib/test/test_socketserver.py
index dd4532f..e4cbb2b 100644
--- a/Lib/test/test_socketserver.py
+++ b/Lib/test/test_socketserver.py
@@ -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:
diff --git a/Misc/NEWS b/Misc/NEWS
index 3a1eea8..5b81b66 100644
--- a/Misc/NEWS
+++ b/Misc/NEWS
@@ -104,6 +104,9 @@ Extension Modules
Tests
-----
+- test_socketserver should now work on cygwin and not fail sporadically
+ on other platforms.
+
- test_mailbox should now work on cygwin versions 2006-08-10 and later.
- Bug #1535182: really test the xreadlines() method of bz2 objects.