Repository navigation
fix(tests): make two tests hold on free-threaded CPython 3.14t (#1731) - #1734
Merged
Merged
Conversation
Two test assumptions, two root causes; no pcapkit change. - test_trial_parse_warnings_1580_unit: test_hold_is_local_to_its_context recorded a warning from an empty context with the enclosing catch_warnings, which context-aware warnings (on by default on a free-threaded build) keep in a context variable that context lacks. It now warns in a context copied before the block, and in an empty context that records for itself. - test_pcapng_unit: the #594 memory-cap subprocess capped the address space at 512 MiB in all, but mimalloc, which a free-threaded build always uses, reserves 1 GiB as the interpreter starts, so the child died loading chardet. The cap is now 512 MiB over what is already mapped; the child runs again under PYTHONMALLOC=mimalloc where the build has it, and its stderr goes into the failure message. Tests: both files pass on 3.14t (context_aware_warnings 1 and 0), 3.14 (0 and 1), 3.11 and 3.8; both tests fail on origin/main on 3.14t. Closes #1731
Owner
Author
|
Verdict: GOOD TO GO at
|
Contributor
|
Coverage: 89.65% (unit tier, Python 3.15,
Per-file detail: the |
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.
Please follow the guide below
You will be asked some questions, please read them carefully and answer honestly
Put an
xinto all the boxes [ ] relevant to your pull request (like that [x])Use Preview tab to see how your pull request will actually look like
Searched for similar pull requests
Followed the coding style (
make pylint,make mypy,make isort)make testpasses, and a test case covers the change. Narrow runs only, listed below.Added a changelog entry under
docs/source/changelog/and regeneratedCHANGELOG.md, if the change is user-visible: N/A — centralised in docs(changelog): shared 1.5.0 changelog — long-lived, merges last (#610, #616, #617, #618, #620) #657What is the purpose of your pull request?
Tick the commit type your subject line carries.
fix— corrects a defectfeat— adds a featureperf— changes performance, not behaviourrefactor— changes neither behaviour nor performancetest— tests onlydocs— documentation onlyci— workflows or build toolingrelease— bumps the version or rolls up a distributionchore— anything elseDescription of your pull request and other information
Closes #1731. Two tests failed on free-threaded CPython 3.14t. Each came from a wrong assumption in the test, not a pcapkit defect, so no library code changes.
test_hold_is_local_to_its_context: under context-aware warnings,catch_warningsrecords through aContextVarthat an emptyContextlacks. Free-threaded builds turn that on by default (CPython docs:-X context_aware_warnings). The failure follows the flag both ways: it fails on regular 3.14 with=1and passes on 3.14t with=0. The test now warns in a context copied before the block, and in an empty context that records for itself.test_the_captured_len_vector_parses_under_a_memory_cap: this one is not about warnings, since it fails on 3.14t with the flag off. mimalloc reserves 1 GiB at start-up (Objects/mimalloc/options.c:86-87), so the 512 MiBRLIMIT_ASwas used up before the parse began. The cap is now 512 MiB above what is already mapped. The child also runs underPYTHONMALLOC=mimallocwhere the build has it, so a GIL leg covers this case too.Tests:
mainboth fail on 3.14t.