Skip to content

Enable PyPy testing#530

Merged
wbarnha merged 11 commits into
masterfrom
pypy-testing
Jun 29, 2023
Merged

Enable PyPy testing#530
wbarnha merged 11 commits into
masterfrom
pypy-testing

Conversation

@wbarnha

@wbarnha wbarnha commented Jun 29, 2023

Copy link
Copy Markdown
Member

No description provided.

@codecov

codecov Bot commented Jun 29, 2023

Copy link
Copy Markdown

Codecov Report

Patch coverage has no change and project coverage change: +0.02 🎉

Comparison is base (600d0ae) 93.70% compared to head (f756906) 93.72%.

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              

see 1 file with indirect coverage changes

☔ View full report in Codecov by Sentry.
📢 Do you have feedback about the report comment? Let us know in this issue.

@wbarnha wbarnha self-assigned this Jun 29, 2023
@wbarnha
wbarnha marked this pull request as ready for review June 29, 2023 19:39
@wbarnha

wbarnha commented Jun 29, 2023

Copy link
Copy Markdown
Member Author

Oddly enough, all tests pass when I run them locally on my machine. Is a dependency somewhere misbehaving?

@wbarnha

wbarnha commented Jun 29, 2023

Copy link
Copy Markdown
Member Author

LGTM for now, we can patch it further later on.

@wbarnha
wbarnha merged commit 7eea54a into master Jun 29, 2023
@wbarnha
wbarnha deleted the pypy-testing branch June 29, 2023 23:18
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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant