[GH-ISSUE #4532] [TUI] The deeply-nested telemetry fixture is stale on a newer Python: 20,000 levels now parse, so the server answers the other message #2045

Closed
opened 2026-11-04 01:56:12 +07:00 by bsakaguchi · 1 comment
Owner

Originally created by @TheHubUser4860938 on GitHub (Oct 28, 2026).
Original GitHub issue: https://github.com/Niko1221/Strata/issues/4532

Problem: tests/terminal/test_connections.py::ConnectionTests::test_deeply_nested_telemetry_returns_one_redacted_error feeds a 20,000-level JSON array and expects the parse to fail:

depth = 20000   # Python 3.13 parses 1100 levels; the recursion limit is reached at a few thousand on every version
body = b"[" * depth + b"0" + b"]" * depth
…
with self.assertRaisesRegex(ClientError, "malformed JSON telemetry"):

On Python 3.14 the comment's premise no longer holds: the parse succeeds, returns a list, and strata_cli/client.py:131 therefore raises the other error - server returned a non-object telemetry response - so the assertion fails on a message that is correct for the payload. Measured on this box:

python 3.14.8
  json.loads at depth   20000: OK -> a list      (so the code says "non-object")
  json.loads at depth  200000: RecursionError: Stack overflow (used 8156 kB) while decoding a JSON array

The code side is fine: client.py:128 catches (ValueError, UnicodeDecodeError, RecursionError), so a payload that genuinely overflows still produces the "malformed JSON telemetry" the test wants.

Environment:
Environment:
Strata Version: 0.2.7.1 (source checkout at tag v0.2.7.1, commit 46c152a1; the test file discussed is upstream's own, unmodified by this fork)
OS: Linux x86-64 - Runtime: Python 3.14.8, Node 26.12.1 for the host suite

Reproduce: python -m pytest tests/terminal/test_connections.py -k deeply_nested on a Python 3.14 host. Measured at three levels (live checkout, clean worktree of the same commit, pure-tag worktree): red in all three, so it is the interpreter, not the checkout. One more thing worth knowing: run as part of the whole tests/terminal batch it can go green in the same tree - the depth at which the C scanner gives out depends on how much stack the process has already used - so this fixture is order-sensitive as well as version-sensitive.

Expected: the fixture proves "a telemetry body the parser cannot take", whatever the interpreter's limit is.

Suggested one-line shape: raise depth past the C scanner's ceiling on every supported interpreter (200,000 overflows here with the 8 MB stack and 8,156 kB used), or accept either message: assertRaisesRegex(ClientError, "malformed JSON telemetry|non-object telemetry response").

Reproduction status: measured on this box (the two json.loads probes above, and the test at three checkout states). Older interpreters were not run here - the overflow arrives earlier the deeper the version's own limit, so a larger depth cannot make it pass less often. This fork raised its own copy's depth to 200,000 for the same reason.

Originally created by @TheHubUser4860938 on GitHub (Oct 28, 2026). Original GitHub issue: https://github.com/Niko1221/Strata/issues/4532 Problem: `tests/terminal/test_connections.py::ConnectionTests::test_deeply_nested_telemetry_returns_one_redacted_error` feeds a 20,000-level JSON array and expects the parse to fail: ```python depth = 20000 # Python 3.13 parses 1100 levels; the recursion limit is reached at a few thousand on every version body = b"[" * depth + b"0" + b"]" * depth … with self.assertRaisesRegex(ClientError, "malformed JSON telemetry"): ``` On Python 3.14 the comment's premise no longer holds: the parse **succeeds**, returns a list, and `strata_cli/client.py:131` therefore raises the *other* error - `server returned a non-object telemetry response` - so the assertion fails on a message that is correct for the payload. Measured on this box: ``` python 3.14.8 json.loads at depth 20000: OK -> a list (so the code says "non-object") json.loads at depth 200000: RecursionError: Stack overflow (used 8156 kB) while decoding a JSON array ``` The code side is fine: `client.py:128` catches `(ValueError, UnicodeDecodeError, RecursionError)`, so a payload that genuinely overflows still produces the "malformed JSON telemetry" the test wants. Environment: Environment: **Strata Version:** 0.2.7.1 (source checkout at tag v0.2.7.1, commit 46c152a1; the test file discussed is upstream's own, unmodified by this fork) **OS:** Linux x86-64 - **Runtime:** Python 3.14.8, Node 26.12.1 for the host suite Reproduce: `python -m pytest tests/terminal/test_connections.py -k deeply_nested` on a Python 3.14 host. Measured at three levels (live checkout, clean worktree of the same commit, pure-tag worktree): red in all three, so it is the interpreter, not the checkout. One more thing worth knowing: run as part of the whole `tests/terminal` batch it can go **green** in the same tree - the depth at which the C scanner gives out depends on how much stack the process has already used - so this fixture is order-sensitive as well as version-sensitive. Expected: the fixture proves "a telemetry body the parser cannot take", whatever the interpreter's limit is. Suggested one-line shape: raise `depth` past the C scanner's ceiling on every supported interpreter (200,000 overflows here with the 8 MB stack and 8,156 kB used), or accept either message: `assertRaisesRegex(ClientError, "malformed JSON telemetry|non-object telemetry response")`. Reproduction status: measured on this box (the two `json.loads` probes above, and the test at three checkout states). Older interpreters were not run here - the overflow arrives *earlier* the deeper the version's own limit, so a larger depth cannot make it pass less often. This fork raised its own copy's depth to 200,000 for the same reason.
Author
Owner

@Niko1221 commented on GitHub (Nov 5, 2026):

Thanks for taking the time to report this.

Strata has changed a lot since this was opened, and 0.2.11 is out now, so many older reports no longer apply. We're closing issues older than a week that have had no new reports in the last week. Closed here does not mean rejected.

To reopen it takes about two minutes:

  1. Re-test on 0.2.11. It may already be fixed. Write down what you see.
  2. Start the title with its area: [Engine], [GUI], [TUI], [Benchmark], [Docs] or [Other].
  3. Fill in the parts of the issue form: what happened, the Strata version, your graphics card, memory and system.
  4. Comment /reopen. A check runs and either reopens the issue or lists what is still missing.

The rules are in CONTRIBUTING.md.

<!-- gh-comment-id:6660618100 --> @Niko1221 commented on GitHub (Nov 5, 2026): Thanks for taking the time to report this. Strata has changed a lot since this was opened, and 0.2.11 is out now, so many older reports no longer apply. We're closing issues older than a week that have had no new reports in the last week. Closed here does not mean rejected. To reopen it takes about two minutes: 1. Re-test on 0.2.11. It may already be fixed. Write down what you see. 2. Start the title with its area: [Engine], [GUI], [TUI], [Benchmark], [Docs] or [Other]. 3. Fill in the parts of the issue form: what happened, the Strata version, your graphics card, memory and system. 4. Comment `/reopen`. A check runs and either reopens the issue or lists what is still missing. The rules are in [CONTRIBUTING.md](https://github.com/Niko1221/Strata/blob/main/CONTRIBUTING.md).
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
Niko1221/Strata#2045
No description provided.