]> git.ipfire.org Git - thirdparty/Python/cpython.git/commit
gh-155109: Run tests exhausting the C stack with a limited C stack (GH-155120)
authorSerhiy Storchaka <storchaka@gmail.com>
Tue, 4 Aug 2026 09:43:48 +0000 (12:43 +0300)
committerGitHub <noreply@github.com>
Tue, 4 Aug 2026 09:43:48 +0000 (09:43 +0000)
commitce5ae29ef9b8ccb32683c922d135339311c36c9d
tree3e5ba18d76e12195904595edd312a870735cfad6
parent2b91da7cd4114e7b264ab4a7b7a1c42b79663a6c
gh-155109: Run tests exhausting the C stack with a limited C stack (GH-155120)

Add the @support.run_with_limited_c_stack() decorator which runs the test
in a thread with a 8 MiB C stack, so that the outcome does not depend on
RLIMIT_STACK. Use it in tests which recurse to a fixed depth --
@support.skip_if_huge_c_stack() failed to skip them with a 16 MiB stack.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
13 files changed:
Lib/test/list_tests.py
Lib/test/mapping_tests.py
Lib/test/support/__init__.py
Lib/test/test_ast/test_ast.py
Lib/test/test_compile.py
Lib/test/test_dict.py
Lib/test/test_dictviews.py
Lib/test/test_exception_group.py
Lib/test/test_json/test_recursion.py
Lib/test/test_pyexpat.py
Lib/test/test_typing.py
Lib/test/test_xml_etree.py
Misc/NEWS.d/next/Tests/2026-08-03-20-15-00.gh-issue-155109.limstack.rst [new file with mode: 0644]