[Python-checkins] r78015 - in python/branches/release26-maint: Lib/test/test_timeout.py Misc/NEWS
r.david.murray
python-checkins at python.org
Sat Feb 6 05:56:33 CET 2010
Author: r.david.murray
Date: Sat Feb 6 05:56:33 2010
New Revision: 78015
Log:
Merged revisions 78014 via svnmerge from
svn+ssh://pythondev@svn.python.org/python/trunk
........
r78014 | r.david.murray | 2010-02-05 23:27:21 -0500 (Fri, 05 Feb 2010) | 5 lines
issue #7728: test_timeout was using a hardcoded port, which was
causing buildbot failures. Changed to use test_support.bind_port.
Patch by Florent Xicluna.
........
Modified:
python/branches/release26-maint/ (props changed)
python/branches/release26-maint/Lib/test/test_timeout.py
python/branches/release26-maint/Misc/NEWS
Modified: python/branches/release26-maint/Lib/test/test_timeout.py
==============================================================================
--- python/branches/release26-maint/Lib/test/test_timeout.py (original)
+++ python/branches/release26-maint/Lib/test/test_timeout.py Sat Feb 6 05:56:33 2010
@@ -101,7 +101,7 @@
def setUp(self):
self.sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
self.addr_remote = ('www.python.org.', 80)
- self.addr_local = ('127.0.0.1', 25339)
+ self.localhost = '127.0.0.1'
def tearDown(self):
self.sock.close()
@@ -146,7 +146,8 @@
# Test accept() timeout
_timeout = 2
self.sock.settimeout(_timeout)
- self.sock.bind(self.addr_local)
+ # Prevent "Address already in use" socket exceptions
+ test_support.bind_port(self.sock, self.localhost)
self.sock.listen(5)
_t1 = time.time()
@@ -163,7 +164,8 @@
_timeout = 2
self.sock = socket.socket(socket.AF_INET, socket.SOCK_DGRAM)
self.sock.settimeout(_timeout)
- self.sock.bind(self.addr_local)
+ # Prevent "Address already in use" socket exceptions
+ test_support.bind_port(self.sock, self.localhost)
_t1 = time.time()
self.failUnlessRaises(socket.error, self.sock.recvfrom, 8192)
Modified: python/branches/release26-maint/Misc/NEWS
==============================================================================
--- python/branches/release26-maint/Misc/NEWS (original)
+++ python/branches/release26-maint/Misc/NEWS Sat Feb 6 05:56:33 2010
@@ -238,6 +238,9 @@
Tests
-----
+- issue #7728: test_timeout was changed to use test_support.bind_port
+ instead of a hard coded port.
+
- Issue #7498: test_multiprocessing now uses test_support.find_unused_port
instead of a hardcoded port number in test_rapid_restart.
More information about the Python-checkins
mailing list