File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 2323from __future__ import annotations
2424
2525import asyncio
26+ import platform
2627import socket
2728import time
2829from functools import cache
3536
3637_MONOTONIC_RESOLUTION = time .get_clock_info ("monotonic" ).resolution
3738
39+ _IS_PYPY = platform .python_implementation () == "PyPy"
40+
3841# get_service_info / async_request timeout for tests using the
3942# `quick_request_timing` fixture. The fixture cuts the initial-query
4043# delay to ~15ms (10ms _LISTENER_TIME + 1-5ms jitter), so 50ms is
4952# the `quick_timing` fixture, which shrinks the browser's first-query
5053# delay from RFC 6762 §5.2's 20-120ms window to 1-5ms; with that shave
5154# the registrar's response lands inside ~10ms and 75ms is ~7x headroom.
52- LOOPBACK_FIND_TIMEOUT = 0.075
55+ # PyPy's JIT is still warming up the first time this path runs early in
56+ # the suite, so the round trip is too slow for 75ms; give it more room.
57+ LOOPBACK_FIND_TIMEOUT = 0.3 if _IS_PYPY else 0.075
5358
5459# IPv6-only `find()` on Linux GitHub runners can hit `[Errno 101] Network
5560# is unreachable` on the `::1` socket and falls back to the `fe80::` link-
You can’t perform that action at this time.
0 commit comments