FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

gh-159293: Restore the recursion limit after the free-threading race test by zolaski333 · Pull Request #159311 · python/cpython · GitHub

Repository navigation

gh-159293: Restore the recursion limit after the free-threading race test - #159311

Merged
freakboy3742 merged 1 commit into
python:mainfrom
zolaski333:codex/gh-159293-restore-recursion-limit
Oct 14, 2026
Merged

freakboy3742 merged 1 commit into
python:mainfrom
zolaski333:codex/gh-159293-restore-recursion-limit

Conversation

zolaski333 commented Oct 13, 2026 •
edited
Loading

Copy link
Copy Markdown
Contributor

test_racing_recursion_limit leaves the interpreter's recursion limit at 199. When tests share a process, the Python lru_cache recursion test and 68 pickle cases subsequently raise RecursionError.

Register a cleanup to restore the original recursion limit even if the race test fails. This preserves the existing concurrency test and follows the TestCase.addCleanup pattern used elsewhere in the suite.

Fixes gh-159293.

Validation on Windows x64, CPython main at 50082b8d893, free-threaded Release build with the GIL disabled:

  • Before the fix: race test passes but changes the limit from 1000 to 199; TestLRUPy.test_lru_recursion has one error and test_pickle has 68 errors.
  • After the fix: limit remains 1000; the same 1086 tests complete without errors (42 skipped).
  • PCbuild/amd64t/python.exe -X dev -m test --single-process --no-randomize test_free_threading test_functools test_pickle: SUCCESS, 1674 tests run, 52 skipped; 55 test files passed and six platform-specific files skipped.
  • Tools/patchcheck/patchcheck.py and git diff --check pass.

@@ -0,0 +1,2 @@
Restore the recursion limit after the free-threading recursion-limit race test

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

Test only changes don't requires a news entry file, please remove it.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

'Tests' is one of the blurb options, for test-only PRs, and this was put in the Tests section.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

aisk added the skip news label Oct 13, 2026
freakboy3742 added needs backport to 3.14 bugs and security fixes needs backport to 3.15 bugs and security fixes labels Oct 14, 2026

freakboy3742 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

Thanks for the fix!

freakboy3742 merged commit aeff4cb into python:main Oct 14, 2026
66 checks passed

Copy link
Copy Markdown

Thanks @zolaski333 for the PR, and @freakboy3742 for merging it 🌮🎉.. I'm working now to backport this PR to: 3.14, 3.15.
🐍🍒⛏🤖

bedevere-app Bot commented Oct 14, 2026

Copy link
Copy Markdown

GH-159389 is a backport of this pull request to the 3.15 branch.

bedevere-app Bot removed the needs backport to 3.15 bugs and security fixes label Oct 14, 2026

bedevere-app Bot commented Oct 14, 2026

Copy link
Copy Markdown

GH-159390 is a backport of this pull request to the 3.14 branch.

bedevere-app Bot removed the needs backport to 3.14 bugs and security fixes label Oct 14, 2026
freakboy3742 pushed a commit that referenced this pull request Oct 14, 2026
…g race test (GH-159311) (#159390)

Adds a cleanup to ensure interpreter state is restored after testing recursion
limit changes.
(cherry picked from commit aeff4cb)

Co-authored-by: Noah <57315647+zolaski333@users.noreply.github.com>
freakboy3742 pushed a commit that referenced this pull request Oct 14, 2026
…g race test (GH-159311) (#159389)

Adds a cleanup to ensure interpreter state is restored after testing recursion
limit changes.
(cherry picked from commit aeff4cb)

Co-authored-by: Noah <57315647+zolaski333@users.noreply.github.com>
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

Labels

skip news tests Tests in the Lib/test dir

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Test ordering error with free-threaded builds

4 participants


Back | FazBrowse Home | New Git URL