Fix the wall-clock timeout tests on Python 3.10 (#7488)

Both tests remove asyncio.timeout to exercise the fallback path in
_wall_clock_timeout. On Python 3.10 that attribute does not exist in the
first place, so monkeypatch.delattr raises AttributeError and Backend CI
fails on its 3.10 leg. raising=False keeps the intent, the attribute is
absent either way.
This commit is contained in:
Daniel Han 2026-07-27 01:58:22 -07:00 committed by GitHub
commit 4a79d707c5
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -861,7 +861,9 @@ def test_stream_completion_timeout_is_absolute_despite_keepalives(monkeypatch):
def test_wall_clock_timeout_supports_python_without_asyncio_timeout(monkeypatch):
monkeypatch.delattr(research_runs.asyncio, "timeout")
# raising=False: on Python 3.10 asyncio.timeout does not exist to begin with,
# which is the very case these tests cover.
monkeypatch.delattr(research_runs.asyncio, "timeout", raising = False)
async def run():
async with research_runs._wall_clock_timeout(0.01):
@ -872,7 +874,9 @@ def test_wall_clock_timeout_supports_python_without_asyncio_timeout(monkeypatch)
def test_wall_clock_timeout_does_not_swallow_shutdown_cancellation(monkeypatch):
monkeypatch.delattr(research_runs.asyncio, "timeout")
# raising=False: on Python 3.10 asyncio.timeout does not exist to begin with,
# which is the very case these tests cover.
monkeypatch.delattr(research_runs.asyncio, "timeout", raising = False)
async def run(cleanup_started: asyncio.Event):
async with research_runs._wall_clock_timeout(0.01):