Skip to content

[PR #12603/dbe83fd0 backport][3.14] Fix flaky test_handler_returns_not_response on PyPy via debug-mode fixture#12608

Merged
bdraco merged 1 commit into
aio-libs:3.14from
bdraco:patchback/backports/3.14/dbe83fd0776fd91b94543c354f5b8172b49a1d15/pr-12603
May 18, 2026
Merged

[PR #12603/dbe83fd0 backport][3.14] Fix flaky test_handler_returns_not_response on PyPy via debug-mode fixture#12608
bdraco merged 1 commit into
aio-libs:3.14from
bdraco:patchback/backports/3.14/dbe83fd0776fd91b94543c354f5b8172b49a1d15/pr-12603

Conversation

@bdraco

@bdraco bdraco commented May 18, 2026

Copy link
Copy Markdown
Member

This is a backport of PR #12603 as merged into master (dbe83fd).

What do these changes do?

Route loop.set_debug(True) through a new loop_debug_mode
fixture in tests/conftest.py so the two failing tests in
tests/test_web_functional.py turn debug off before the
aiohttp_client fixture finalizes. The fixture is requested as
the last test parameter so pytest tears it down before
aiohttp_client.

Leaving debug on through teardown let PyPy 3.11's asyncio
slow-callback logger walk into Task.__repr__ during connector
close, surfacing a spurious RuntimeWarning: coroutine was never awaited that filterwarnings = error promotes to a teardown
failure. CPython's reprlib.recursive_repr keeps the same walk
bounded so the flake only manifested on the PyPy CI leg, as seen
on https://github.com/aio-libs/aiohttp/actions/runs/26003637612/job/76431289229.

Are there changes in behavior for the user?

No. Tests-only.

Is it a substantial burden for the maintainers to support this?

No.

Related issue number

None.

Checklist

  • I think the code is well written
  • Unit tests for the changes exist (the changes are themselves to tests)
  • Documentation reflects the changes N/A
  • If you provide code modification, please add yourself to CONTRIBUTORS.txt
  • Add a new news fragment into the CHANGES/ folder
Agent run details (optional, for reviewers)

Verified the fixture teardown order with an instrumented probe: the
aiohttp_client teardown runs after loop_debug_mode has set
debug back to False when loop_debug_mode is the last test
parameter. Ran the two affected tests against the default C build
and AIOHTTP_NO_EXTENSIONS=1 on CPython 3.14; both pass. The
PyPy 3.11 leg cannot be reproduced locally and will be verified by
CI on this PR.

make doc-spelling passes on the new fragment (pre-existing
flakey / accessor warnings in older fragments are
unaffected).

Drafted with Claude Code (claude-opus-4-7); reviewed by @bdraco.

@bdraco bdraco requested review from asvetlov and webknjaz as code owners May 18, 2026 00:38
@psf-chronographer psf-chronographer Bot added the bot:chronographer:provided There is a change note present in this PR label May 18, 2026
@bdraco bdraco enabled auto-merge (squash) May 18, 2026 00:40
@codecov

codecov Bot commented May 18, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 98.20%. Comparing base (e81a7d9) to head (9929ded).
⚠️ Report is 1 commits behind head on 3.14.
✅ All tests successful. No failed tests found.

Additional details and impacted files
@@           Coverage Diff           @@
##             3.14   #12608   +/-   ##
=======================================
  Coverage   98.20%   98.20%           
=======================================
  Files         135      135           
  Lines       47245    47250    +5     
  Branches     2536     2536           
=======================================
+ Hits        46397    46403    +6     
  Misses        671      671           
+ Partials      177      176    -1     
Flag Coverage Δ
CI-GHA 98.26% <100.00%> (+<0.01%) ⬆️
OS-Linux 98.02% <100.00%> (+<0.01%) ⬆️
OS-Windows 95.66% <100.00%> (+<0.01%) ⬆️
OS-macOS 97.20% <100.00%> (+<0.01%) ⬆️
Py-3.10.11 96.68% <100.00%> (+<0.01%) ⬆️
Py-3.10.20 97.16% <100.00%> (+<0.01%) ⬆️
Py-3.11.15 97.44% <100.00%> (+<0.01%) ⬆️
Py-3.11.9 96.97% <100.00%> (+<0.01%) ⬆️
Py-3.12.10 97.05% <100.00%> (+<0.01%) ⬆️
Py-3.12.13 97.53% <100.00%> (+<0.01%) ⬆️
Py-3.13.13 97.74% <100.00%> (+<0.01%) ⬆️
Py-3.14.4 96.97% <100.00%> (+<0.01%) ⬆️
Py-3.14.5 97.56% <100.00%> (+<0.01%) ⬆️
Py-3.14.5t 96.81% <100.00%> (-0.01%) ⬇️
Py-pypy3.11.15-7.3.22 96.66% <100.00%> (+<0.01%) ⬆️
VM-macos 97.20% <100.00%> (+<0.01%) ⬆️
VM-ubuntu 98.02% <100.00%> (+<0.01%) ⬆️
VM-windows 95.66% <100.00%> (+<0.01%) ⬆️
cython-coverage 38.03% <100.00%> (+<0.01%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@codspeed-hq

codspeed-hq Bot commented May 18, 2026

Copy link
Copy Markdown

Merging this PR will not alter performance

✅ 67 untouched benchmarks
⏩ 7 skipped benchmarks1


Comparing bdraco:patchback/backports/3.14/dbe83fd0776fd91b94543c354f5b8172b49a1d15/pr-12603 (9929ded) with 3.14 (2382ac9)2

Open in CodSpeed

Footnotes

  1. 7 benchmarks were skipped, so the baseline results were used instead. If they were deleted from the codebase, click here and archive them to remove them from the performance reports.

  2. No successful run was found on 3.14 (e81a7d9) during the generation of this report, so 2382ac9 was used instead as the comparison base. There might be some changes unrelated to this pull request in this report.

@bdraco bdraco merged commit c284e21 into aio-libs:3.14 May 18, 2026
40 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bot:chronographer:provided There is a change note present in this PR

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant