Skip to content

Commit 25b5f1e

Browse files
authored
Longer test timeout (#497)
* Fix tests: 15s SSL_HANDSHAKE_TIMEOUT Also allow longer time for slow tests on qemu aarch64 for GitHub Actions * Build sdist on 22.04 to support LoongArch
1 parent 598b16f commit 25b5f1e

File tree

4 files changed

+20
-11
lines changed

4 files changed

+20
-11
lines changed

.github/workflows/release.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ jobs:
4444

4545
build-sdist:
4646
needs: validate-release-request
47-
runs-on: ubuntu-latest
47+
runs-on: ubuntu-22.04
4848

4949
env:
5050
PIP_DISABLE_PIP_VERSION_CHECK: 1

tests/test_dns.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -165,7 +165,8 @@ def test_getaddrinfo_18(self):
165165

166166
def test_getaddrinfo_19(self):
167167
# musl always returns ai_canonname while macOS never return for IPs,
168-
# but we strictly follow the docs to use the AI_CANONNAME flag
168+
# but we strictly follow the docs to use the AI_CANONNAME flag in a
169+
# shortcut __static_getaddrinfo_pyaddr()
169170
patch = self.implementation != 'asyncio'
170171

171172
self._test_getaddrinfo('::1', 80)
@@ -176,7 +177,8 @@ def test_getaddrinfo_19(self):
176177

177178
def test_getaddrinfo_20(self):
178179
# musl always returns ai_canonname while macOS never return for IPs,
179-
# but we strictly follow the docs to use the AI_CANONNAME flag
180+
# but we strictly follow the docs to use the AI_CANONNAME flag in a
181+
# shortcut __static_getaddrinfo_pyaddr()
180182
patch = self.implementation != 'asyncio'
181183

182184
self._test_getaddrinfo('127.0.0.1', 80)

tests/test_tcp.py

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -319,7 +319,8 @@ def test_create_server_8(self):
319319
ValueError, 'ssl_handshake_timeout is only meaningful'):
320320
self.loop.run_until_complete(
321321
self.loop.create_server(
322-
lambda: None, host='::', port=0, ssl_handshake_timeout=10))
322+
lambda: None, host='::', port=0,
323+
ssl_handshake_timeout=SSL_HANDSHAKE_TIMEOUT))
323324

324325
def test_create_server_9(self):
325326
async def handle_client(reader, writer):
@@ -550,7 +551,8 @@ def test_create_connection_6(self):
550551
ValueError, 'ssl_handshake_timeout is only meaningful'):
551552
self.loop.run_until_complete(
552553
self.loop.create_connection(
553-
lambda: None, host='::', port=0, ssl_handshake_timeout=10))
554+
lambda: None, host='::', port=0,
555+
ssl_handshake_timeout=SSL_HANDSHAKE_TIMEOUT))
554556

555557
def test_transport_shutdown(self):
556558
CNT = 0 # number of clients that were successful
@@ -1224,7 +1226,7 @@ class _TestSSL(tb.SSLTestCase):
12241226
def test_create_server_ssl_1(self):
12251227
CNT = 0 # number of clients that were successful
12261228
TOTAL_CNT = 25 # total number of clients that test will create
1227-
TIMEOUT = 10.0 # timeout for this test
1229+
TIMEOUT = 20.0 # timeout for this test
12281230

12291231
A_DATA = b'A' * 1024 * 1024
12301232
B_DATA = b'B' * 1024 * 1024
@@ -2038,7 +2040,7 @@ def test_create_server_ssl_over_ssl(self):
20382040

20392041
CNT = 0 # number of clients that were successful
20402042
TOTAL_CNT = 25 # total number of clients that test will create
2041-
TIMEOUT = 20.0 # timeout for this test
2043+
TIMEOUT = 60.0 # timeout for this test
20422044

20432045
A_DATA = b'A' * 1024 * 1024
20442046
B_DATA = b'B' * 1024 * 1024

tests/test_unix.py

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,9 @@
1010
from uvloop import _testbase as tb
1111

1212

13+
SSL_HANDSHAKE_TIMEOUT = 15.0
14+
15+
1316
class _TestUnix:
1417
def test_create_unix_server_1(self):
1518
CNT = 0 # number of clients that were successful
@@ -160,7 +163,8 @@ def test_create_unix_server_3(self):
160163
ValueError, 'ssl_handshake_timeout is only meaningful'):
161164
self.loop.run_until_complete(
162165
self.loop.create_unix_server(
163-
lambda: None, path='/tmp/a', ssl_handshake_timeout=10))
166+
lambda: None, path='/tmp/a',
167+
ssl_handshake_timeout=SSL_HANDSHAKE_TIMEOUT))
164168

165169
def test_create_unix_server_existing_path_sock(self):
166170
with self.unix_sock_name() as path:
@@ -368,7 +372,8 @@ def test_create_unix_connection_6(self):
368372
ValueError, 'ssl_handshake_timeout is only meaningful'):
369373
self.loop.run_until_complete(
370374
self.loop.create_unix_connection(
371-
lambda: None, path='/tmp/a', ssl_handshake_timeout=10))
375+
lambda: None, path='/tmp/a',
376+
ssl_handshake_timeout=SSL_HANDSHAKE_TIMEOUT))
372377

373378

374379
class Test_UV_Unix(_TestUnix, tb.UVTestCase):
@@ -567,7 +572,7 @@ def prog(sock):
567572
await fut
568573

569574
async def start_server():
570-
extras = dict(ssl_handshake_timeout=10.0)
575+
extras = dict(ssl_handshake_timeout=SSL_HANDSHAKE_TIMEOUT)
571576

572577
with tempfile.TemporaryDirectory() as td:
573578
sock_name = os.path.join(td, 'sock')
@@ -628,7 +633,7 @@ def server(sock):
628633
sock.close()
629634

630635
async def client(addr):
631-
extras = dict(ssl_handshake_timeout=10.0)
636+
extras = dict(ssl_handshake_timeout=SSL_HANDSHAKE_TIMEOUT)
632637

633638
reader, writer = await asyncio.open_unix_connection(
634639
addr,

0 commit comments

Comments
 (0)