gh-126876: Fix test_socket.testLargeTimeout() for missing _testcapi (#127517)
This commit is contained in:
parent
7c2bd9b226
commit
c46acd3588
@ -5136,7 +5136,10 @@ class NonBlockingTCPTests(ThreadedTCPSocketTest):
|
|||||||
# gh-126876: Check that a timeout larger than INT_MAX is replaced with
|
# gh-126876: Check that a timeout larger than INT_MAX is replaced with
|
||||||
# INT_MAX in the poll() code path. The following assertion must not
|
# INT_MAX in the poll() code path. The following assertion must not
|
||||||
# fail: assert(INT_MIN <= ms && ms <= INT_MAX).
|
# fail: assert(INT_MIN <= ms && ms <= INT_MAX).
|
||||||
|
if _testcapi is not None:
|
||||||
large_timeout = _testcapi.INT_MAX + 1
|
large_timeout = _testcapi.INT_MAX + 1
|
||||||
|
else:
|
||||||
|
large_timeout = 2147483648
|
||||||
|
|
||||||
# test recv() with large timeout
|
# test recv() with large timeout
|
||||||
conn, addr = self.serv.accept()
|
conn, addr = self.serv.accept()
|
||||||
@ -5151,7 +5154,10 @@ class NonBlockingTCPTests(ThreadedTCPSocketTest):
|
|||||||
|
|
||||||
def _testLargeTimeout(self):
|
def _testLargeTimeout(self):
|
||||||
# test sendall() with large timeout
|
# test sendall() with large timeout
|
||||||
|
if _testcapi is not None:
|
||||||
large_timeout = _testcapi.INT_MAX + 1
|
large_timeout = _testcapi.INT_MAX + 1
|
||||||
|
else:
|
||||||
|
large_timeout = 2147483648
|
||||||
self.cli.connect((HOST, self.port))
|
self.cli.connect((HOST, self.port))
|
||||||
try:
|
try:
|
||||||
self.cli.settimeout(large_timeout)
|
self.cli.settimeout(large_timeout)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user