diff options
author | Peter Bierma <zintensitydev@gmail.com> | 2025-01-12 13:04:30 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2025-01-12 13:04:30 (GMT) |
commit | f6c61bf2d7d8b66ccd9f16e723546bdcc251a3d0 (patch) | |
tree | 52d9c1e862ff3ba77df14cadcdc74f7a9de6f699 /Lib/test | |
parent | ff39e3ff7bebc9d700d89c5cd22145db2c879cf2 (diff) | |
download | cpython-f6c61bf2d7d8b66ccd9f16e723546bdcc251a3d0.zip cpython-f6c61bf2d7d8b66ccd9f16e723546bdcc251a3d0.tar.gz cpython-f6c61bf2d7d8b66ccd9f16e723546bdcc251a3d0.tar.bz2 |
gh-128717: Stop-the-world when setting the recursion limit (#128741)
Diffstat (limited to 'Lib/test')
-rw-r--r-- | Lib/test/test_free_threading/test_races.py | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/Lib/test/test_free_threading/test_races.py b/Lib/test/test_free_threading/test_races.py index 6998255..85aa69c 100644 --- a/Lib/test/test_free_threading/test_races.py +++ b/Lib/test/test_free_threading/test_races.py @@ -270,6 +270,21 @@ class TestRaces(TestBase): do_race(set_value, mutate) + def test_racing_recursion_limit(self): + def something_recursive(): + def count(n): + if n > 0: + return count(n - 1) + 1 + return 0 + + count(50) + + def set_recursion_limit(): + for limit in range(100, 200): + sys.setrecursionlimit(limit) + + do_race(something_recursive, set_recursion_limit) + if __name__ == "__main__": unittest.main() |