aiohttp icon indicating copy to clipboard operation
aiohttp copied to clipboard

`test_aiohttp_request_ctx_manager_not_found` fails intermittently

Open sarahec opened this issue 5 months ago • 3 comments

Describe the bug

While rebuilding python313Packages.aiohttp @ 3.12.10 on nixpkgs, tests/test_client_functional.py::test_aiohttp_request_ctx_manager_not_found[pyloop] was failing intermittently (~25%) on aarch64-Darwin with AssertionError: never executed

To Reproduce

Using nix on a M-series Mac: nix-build -A python313Packages.aiohttp --check and observe it fails about a quarter of the time.

Expected behavior

The test should be reliable.

Logs/tracebacks

n/a

Python Version

$ python --version

3.13.4

aiohttp Version

$ python -m pip show aiohttp

3.12.10

multidict Version

$ python -m pip show multidict
6.4.4

propcache Version

$ python -m pip show propcache
0.3.1

yarl Version

$ python -m pip show yarl
1.20.0

OS

Nix on MacOS (aarch64-darwin)

Related component

Client

Additional context

No response

Code of Conduct

  • [x] I agree to follow the aio-libs Code of Conduct

sarahec avatar Jul 10 '25 00:07 sarahec

Traceback would be useful..

Though we still have a few flaky tests we see in CI sometimes (though certainly not 25% of the time, otherwise we'd see a failure on every PR).

Dreamsorcerer avatar Jul 10 '25 10:07 Dreamsorcerer

It appears to be load-sensitive. I'll see if I can get you a traceback.

sarahec avatar Jul 10 '25 21:07 sarahec

I've just looked at the test, and it's only:

async def test_aiohttp_request_ctx_manager_not_found() -> None:
    with pytest.raises(aiohttp.ClientConnectionError):
        async with aiohttp.request("GET", "http://wrong-dns-name.com"):
            assert False

I'm not clear what it's even trying to test. Seems to me like it relies on that domain not being registered, which is rather weird...

Dreamsorcerer avatar Jul 11 '25 16:07 Dreamsorcerer