cpython/Lib/test/test_json
Miss Islington (bot) 1b457d3bbc
[3.15] Skip test_highly_nested_objects_decoding during the PGO profile task. (GH-151460) (#151468)
Skip test_highly_nested_objects_decoding during the PGO profile task. (GH-151460)

Since the recursion guard tracks real C-stack bounds (gh-91079), this test
asserts that 500k nesting levels overflow the stack margin. On a 64 MiB stack
(some Nix build envs use one that large), the optimized interpreter uses ~160
bytes/level (raises at ~420k levels) so the assertion holds with only ~16%
margin; the PGO *instrumented* stage inlines less, its per-level scanner frames
are smaller, and the 500k-deep decode completes -- "RecursionError not raised"
fails the profile run and aborts `make profile-opt`. Upstream's
skip_if_unlimited_stack_size (gh-143460) only covers RLIM_INFINITY, not
large-finite stacks like ours.

We could also keep playing whack a mole and raise the 500k to a much larger
number... but there's little value in PGO training on this test anyways.
(cherry picked from commit e91f68ab40)

Co-authored-by: Gregory P. Smith <68491+gpshead@users.noreply.github.com>
2026-06-14 11:37:23 -07:00
..
__init__.py gh-76007: Deprecate __version__ attribute (#138675) 2025-09-29 12:03:23 +03:00
__main__.py
json_lines.jsonl gh-132631: Fix "I/O operation on closed file" when parsing JSON Lines file (#132632) 2026-04-23 15:27:02 +00:00
test_decode.py [3.15] gh-149056: Properly pass array_hook in json.load() to json.loads() (GH-149057) (GH-150591) 2026-05-29 21:30:50 +00:00
test_default.py gh-122163: Add notes for JSON serialization errors (GH-122165) 2024-07-23 20:02:54 +03:00
test_dump.py gh-145244: Fix use-after-free on borrowed dict key in json encoder (GH-145245) 2026-04-11 22:26:36 +00:00
test_encode_basestring_ascii.py gh-148241: Fix json serialization for str subclasses (#148249) 2026-04-09 13:50:44 +02:00
test_enum.py gh-148241: Fix json serialization for str subclasses (#148249) 2026-04-09 13:50:44 +02:00
test_fail.py gh-71339: Use new assertion methods in tests (GH-129046) 2025-05-22 13:17:22 +03:00
test_float.py
test_indent.py
test_pass1.py
test_pass2.py
test_pass3.py
test_recursion.py [3.15] Skip test_highly_nested_objects_decoding during the PGO profile task. (GH-151460) (#151468) 2026-06-14 11:37:23 -07:00
test_scanstring.py gh-137821: Improve Argument Clinic definitions in the `_json` module (#140780) 2025-10-30 10:32:08 +00:00
test_separators.py
test_speedups.py gh-142831: Fix use-after-free in json encoder during re-entrant mutation (gh-142851) 2026-04-12 00:14:50 +00:00
test_tool.py gh-132631: Fix "I/O operation on closed file" when parsing JSON Lines file (#132632) 2026-04-23 15:27:02 +00:00
test_unicode.py gh-140793: Improve documentatation and tests for the ensure_ascii option in the json module (GH-140906) 2025-11-08 12:07:27 +02:00