summaryrefslogtreecommitdiffstats
path: root/Lib/test/test_socket.py
diff options
context:
space:
mode:
authorCharles-François Natali <cf.natali@gmail.com>2013-08-29 17:01:40 (GMT)
committerCharles-François Natali <cf.natali@gmail.com>2013-08-29 17:01:40 (GMT)
commit5fd2642adb3874a4e6efc72a0782f4e98e7c6ad0 (patch)
treea9d9a7deec5dbb3d9df43d06e01364c6a8dc6401 /Lib/test/test_socket.py
parent4af4d273bd2c18e8e3d56dc43a877ce04a5a1e13 (diff)
downloadcpython-5fd2642adb3874a4e6efc72a0782f4e98e7c6ad0.zip
cpython-5fd2642adb3874a4e6efc72a0782f4e98e7c6ad0.tar.gz
cpython-5fd2642adb3874a4e6efc72a0782f4e98e7c6ad0.tar.bz2
Issue #18643: Fix some test_socket failures due to large default socket buffer
sizes.
Diffstat (limited to 'Lib/test/test_socket.py')
-rw-r--r--Lib/test/test_socket.py7
1 files changed, 4 insertions, 3 deletions
diff --git a/Lib/test/test_socket.py b/Lib/test/test_socket.py
index 9567090..b95e1ab 100644
--- a/Lib/test/test_socket.py
+++ b/Lib/test/test_socket.py
@@ -1210,11 +1210,12 @@ class GeneralModuleTests(unittest.TestCase):
c.settimeout(1.5)
with self.assertRaises(ZeroDivisionError):
signal.alarm(1)
- c.sendall(b"x" * (1024**2))
+ c.sendall(b"x" * support.SOCK_MAX_SIZE)
if with_timeout:
signal.signal(signal.SIGALRM, ok_handler)
signal.alarm(1)
- self.assertRaises(socket.timeout, c.sendall, b"x" * (1024**2))
+ self.assertRaises(socket.timeout, c.sendall,
+ b"x" * support.SOCK_MAX_SIZE)
finally:
signal.alarm(0)
signal.signal(signal.SIGALRM, old_alarm)
@@ -4047,7 +4048,7 @@ class UnbufferedFileObjectClassTestCase(FileObjectClassTestCase):
self.serv_skipped = None
self.serv_conn.setblocking(False)
# Try to saturate the socket buffer pipe with repeated large writes.
- BIG = b"x" * (1024 ** 2)
+ BIG = b"x" * support.SOCK_MAX_SIZE
LIMIT = 10
# The first write() succeeds since a chunk of data can be buffered
n = self.write_file.write(BIG)