diff --git a/CHANGES/9705.contrib.rst b/CHANGES/9705.contrib.rst new file mode 100644 index 00000000000..5eaef0c4398 --- /dev/null +++ b/CHANGES/9705.contrib.rst @@ -0,0 +1,2 @@ +Reduced the runtime of a client timeout regression test by shortening its artificial response delay. +-- by :user:`nightcityblade`. diff --git a/CONTRIBUTORS.txt b/CONTRIBUTORS.txt index b65e45ddc4a..4a9c56233f3 100644 --- a/CONTRIBUTORS.txt +++ b/CONTRIBUTORS.txt @@ -286,6 +286,7 @@ Moss Collum Mun Gwan-gyeong Navid Sheikhol Nicolas Braem +Night Cityblade Nikolay Kim Nikolay Novik Nikolay Tiunov diff --git a/requirements/constraints.txt b/requirements/constraints.txt index 9257be278a7..d29fcac2147 100644 --- a/requirements/constraints.txt +++ b/requirements/constraints.txt @@ -216,7 +216,7 @@ pytest-aiohttp==1.1.0 # via # -r requirements/lint.in # -r requirements/test-common.in -pytest-asyncio==1.4.0a2 +pytest-asyncio==1.4.0 # via pytest-aiohttp pytest-codspeed==5.0.3 # via diff --git a/requirements/dev.txt b/requirements/dev.txt index c92d6efe84a..762e5d0a829 100644 --- a/requirements/dev.txt +++ b/requirements/dev.txt @@ -211,7 +211,7 @@ pytest-aiohttp==1.1.0 # via # -r requirements/lint.in # -r requirements/test-common.in -pytest-asyncio==1.4.0a2 +pytest-asyncio==1.4.0 # via pytest-aiohttp pytest-codspeed==5.0.3 # via diff --git a/requirements/lint.txt b/requirements/lint.txt index 4b9148dd22d..d731a1ae94e 100644 --- a/requirements/lint.txt +++ b/requirements/lint.txt @@ -119,7 +119,7 @@ pytest==9.0.3 # pytest-mock pytest-aiohttp==1.1.0 # via -r requirements/lint.in -pytest-asyncio==1.4.0a2 +pytest-asyncio==1.4.0 # via pytest-aiohttp pytest-codspeed==5.0.3 # via -r requirements/lint.in diff --git a/requirements/test-common.txt b/requirements/test-common.txt index 3c688524b8d..bac85c47eae 100644 --- a/requirements/test-common.txt +++ b/requirements/test-common.txt @@ -104,7 +104,7 @@ pytest==9.0.3 # pytest-xdist pytest-aiohttp==1.1.0 # via -r requirements/test-common.in -pytest-asyncio==1.3.0 +pytest-asyncio==1.4.0 # via pytest-aiohttp pytest-codspeed==5.0.3 # via -r requirements/test-common.in diff --git a/requirements/test-ft.txt b/requirements/test-ft.txt index 64312de99a1..142d75bf348 100644 --- a/requirements/test-ft.txt +++ b/requirements/test-ft.txt @@ -127,7 +127,7 @@ pytest==9.0.3 # pytest-xdist pytest-aiohttp==1.1.0 # via -r requirements/test-common.in -pytest-asyncio==1.4.0a2 +pytest-asyncio==1.4.0 # via pytest-aiohttp pytest-codspeed==5.0.3 # via -r requirements/test-common.in diff --git a/requirements/test.txt b/requirements/test.txt index 1b14c7cd9f6..60d5accb62f 100644 --- a/requirements/test.txt +++ b/requirements/test.txt @@ -127,7 +127,7 @@ pytest==9.0.3 # pytest-xdist pytest-aiohttp==1.1.0 # via -r requirements/test-common.in -pytest-asyncio==1.4.0a2 +pytest-asyncio==1.4.0 # via pytest-aiohttp pytest-codspeed==5.0.3 # via -r requirements/test-common.in diff --git a/tests/test_client_functional.py b/tests/test_client_functional.py index 54a1245972b..a301b6b82cd 100644 --- a/tests/test_client_functional.py +++ b/tests/test_client_functional.py @@ -1159,17 +1159,17 @@ async def test_read_timeout_between_chunks( async def handler(request: web.Request) -> web.StreamResponse: resp = aiohttp.web.StreamResponse() await resp.prepare(request) - # write data 4 times, with pauses. Total time 2 seconds. + # write data 4 times, with pauses. Total time 0.4 seconds. for _ in range(4): - await asyncio.sleep(0.5) + await asyncio.sleep(0.1) await resp.write(b"data\n") return resp app = web.Application() app.add_routes([web.get("/", handler)]) - # A timeout of 0.2 seconds should apply per read. - timeout = aiohttp.ClientTimeout(sock_read=1) + # The read timeout should apply per read, not to the whole response. + timeout = aiohttp.ClientTimeout(sock_read=0.2) client = await aiohttp_client(app, timeout=timeout) res = b""