Skip to content

Commit 8934a07

Browse files
committed
Increase recursion depth for test_json from 200k to 500k
1 parent fa176fe commit 8934a07

File tree

2 files changed

+29
-1
lines changed

2 files changed

+29
-1
lines changed

cpython-unix/build-cpython.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -566,7 +566,7 @@ fi
566566
# On 3.14+ `test_json.test_recursion.TestCRecursion.test_highly_nested_objects_decoding` fails during
567567
# PGO due to RecursionError not being raised as expected. See https://github.com/python/cpython/issues/140125
568568
if [[ -n "${PYTHON_MEETS_MINIMUM_VERSION_3_14}" ]]; then
569-
PROFILE_TASK="${PROFILE_TASK} --ignore test_json"
569+
patch -p1 -i "${ROOT}/patch-test-json.patch"
570570
fi
571571

572572
# ./configure tries to auto-detect whether it can build 128-bit and 256-bit SIMD helpers for HACL,

cpython-unix/patch-test-json.patch

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
commit c7281478147d2a3859dd04ed3729593e9e4f2b73
2+
Author: Zanie Blue <contact@zanie.dev>
3+
Date: Wed Dec 3 08:17:23 2025 -0600
4+
5+
Increase recursion depth for `test_json` from 200k to 500k
6+
7+
diff --git a/Lib/test/test_json/test_recursion.py b/Lib/test/test_json/test_recursion.py
8+
index 5d7b56ff9ad..3110ce746b8 100644
9+
--- a/Lib/test/test_json/test_recursion.py
10+
+++ b/Lib/test/test_json/test_recursion.py
11+
@@ -71,7 +71,7 @@ def default(self, o):
12+
@support.skip_emscripten_stack_overflow()
13+
@support.skip_wasi_stack_overflow()
14+
def test_highly_nested_objects_decoding(self):
15+
- very_deep = 200000
16+
+ very_deep = 500000
17+
# test that loading highly-nested objects doesn't segfault when C
18+
# accelerations are used. See #12017
19+
with self.assertRaises(RecursionError):
20+
@@ -90,7 +90,7 @@ def test_highly_nested_objects_decoding(self):
21+
def test_highly_nested_objects_encoding(self):
22+
# See #12051
23+
l, d = [], {}
24+
- for x in range(200_000):
25+
+ for x in range(500_000):
26+
l, d = [l], {'k':d}
27+
with self.assertRaises(RecursionError):
28+
with support.infinite_recursion(5000):

0 commit comments

Comments
 (0)