Repository navigation
test: give GraalPy's finaliser time to run after gc.collect (#1963) - #2010
Merged
Merged
Conversation
…1963) - GraalPy's gc.collect forces a full Java GC, sleeps 15 ms and runs only the weak reference callbacks queued by then (GcModuleBuiltins.javaCollect, graal-25.4.4), so on a loaded runner the #1997 finaliser can run after it returns; job 118912680486 failed test_finaliser_alone_releases_an_abandoned_handle with the handle still open - new collect_until keeps collecting up to FINALISER_GRACE, 10 s on GraalPy and none on CPython, so a finaliser that never runs still fails; used there and in test_extractor_abandoned_before_eof_still_releases_its_handle - new stand-in test pins that the helper waits out a late finaliser The file passes on CPython and GraalPy 25.4.4; the tier guard passes. Refs #1963
JarryShaw
force-pushed
the
test/1963-graalpy-main-run
branch
from
October 21, 2026 00:22
190b489 to
c33e6b7
Compare
Owner
Author
|
GOOD TO GO at
|
Contributor
|
Coverage: 91.54% (unit tier, Python 3.15,
Per-file detail: the |
This was referenced Oct 21, 2026
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.
make pylint,make mypy,make isort)make testpasses, and a test case covers the changeWhat is the purpose of your pull request?
test— tests onlyDescription of your pull request and other information
On GraalPy,
test_finaliser_alone_releases_an_abandoned_handlefailed onmain's first full GraalPy run (job 118912680486).GraalPy's
gc.collectforces a Java GC, sleeps briefly, and then runs only the weak-reference callbacks that are queued by that point (GcModuleBuiltins.javaCollect, graal-25.4.4). Under load, aweakref.finalizecan therefore run aftercollectreturns.A new
collect_untilhelper keeps collecting for up toFINALISER_GRACE: 10 s on GraalPy, 0 on CPython. A finaliser that never runs still fails. A stand-in finaliser that runs only on the third collection shows the helper waits for it. I could not reproduce the failure locally, so the cause is inferred from GraalPy's source.The run's nine other FAILED ids were worker crashes, not test failures. Each worker hit
--vm.Xmx2gwithExitOnOutOfMemoryErrorafter its heap grew across tests. Each of those tests passes alone on GraalPy, so gating them would be wrong. The fix for the crashes goes to the GraalPy leg separately.Overlaps #2000 in
test_extraction_ownership.py; I'll rebase whichever lands second.Part of #1963.