Enable PyPy testing#530
Merged
Merged
Conversation
Codecov ReportPatch coverage has no change and project coverage change:
Additional details and impacted files@@ Coverage Diff @@
## master #530 +/- ##
==========================================
+ Coverage 93.70% 93.72% +0.02%
==========================================
Files 102 102
Lines 11145 11145
Branches 1531 1531
==========================================
+ Hits 10443 10446 +3
+ Misses 614 611 -3
Partials 88 88 ☔ View full report in Codecov by Sentry. |
wbarnha
marked this pull request as ready for review
June 29, 2023 19:39
Member
Author
|
Oddly enough, all tests pass when I run them locally on my machine. Is a dependency somewhere misbehaving? |
Member
Author
|
LGTM for now, we can patch it further later on. |
wbarnha
added a commit
that referenced
this pull request
Jul 20, 2026
Extend the on_stop generator-cleanup mechanism to the main stream iterator (__aiter__ -> _py_aiter/_c_aiter), whose inner finally acks the last-yielded event and whose outer finally detaches from the channel -- previously only the take() family was tracked, so a plain `async for value in stream: break` still leaked its cleanup to GC timing on PyPy. Service.stop() sets _stopped before awaiting on_stop(), so the outer finally's re-entrant self.stop() is a guarded no-op. Make the test suite PyPy-clean and remove every skipif(PyPy) marker (21 decorators covering 30 tests, added wholesale against PyPy 3.9 in #530/#621 and never re-validated): * tests/conftest.py: override the event_loop fixture to run gc.collect() + loop.shutdown_asyncgens() before closing the loop on PyPy, so deferred async-generator finalizers run inside the owning test instead of landing on a dead loop and leaking tasks/warnings into later tests. * tests/meticulous: disable the 4s hypothesis deadline on PyPy -- JIT warm-up makes the first examples orders of magnitude slower than steady state, tripping DeadlineExceeded on correct code. * New regression test test_aiter_cleanup_on_stream_stop mirrors the take() one: holds a strong reference (blocking finalization on every interpreter, mimicking PyPy) and asserts stop-time cleanup acks the event. Verified to fail without the __aiter__ tracking. Verified on CPython: functional+unit+meticulous suites green with Cython enabled AND with NO_CYTHON=1 (the pure-Python paths PyPy uses), and green under a PyPy-semantics simulation (an asyncgen firstiter hook holding strong references to defeat refcount finalization). Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01HHPL4VFWQRQPpjR1gXSKyL
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.