pytorch - 💡(How to fix) Fix DISABLED test_threaded_weak_key_dict_copy (__main__.WeakTest) [2 comments, 1 participants]

Official PRs (…)
ON THIS PAGE

GitHub issue graph ai analysis

Paste a GitHub issue URL. We fetch that issue, discover linked issues from bodies/comments/timeline, collect linked pull requests, and produce a structured English report.

The report is written in English Markdown for sharing and archival.

Helpful · Quick feedback

Loading…
GitHub stats
pytorch/pytorch#182094Fetched 2026-05-02 05:27:24
View on GitHub
Comments
2
Participants
1
Timeline
26
Reactions
0
Participants
Timeline (top)
mentioned ×10subscribed ×10labeled ×4commented ×2

Error Message

Traceback (most recent call last): File "/opt/conda/envs/py_3.14/lib/python3.14t/site-packages/_pytest/unraisableexception.py", line 117, in unraisable_hook traceback.format_exception( ~~~~~~~~~~~~~~~~~~~~~~~~~~^ unraisable.exc_type, ^^^^^^^^^^^^^^^^^^^^ unraisable.exc_value, ^^^^^^^^^^^^^^^^^^^^^ unraisable.exc_traceback, ^^^^^^^^^^^^^^^^^^^^^^^^^ ) ^ RecursionError: maximum recursion depth exceeded

The above exception was the direct cause of the following exception:

Traceback (most recent call last): File "/opt/conda/envs/py_3.14/lib/python3.14t/site-packages/_pytest/runner.py", line 353, in from_call result: TResult | None = func() ~~~~^^ File "/opt/conda/envs/py_3.14/lib/python3.14t/site-packages/_pytest/runner.py", line 245, in <lambda> lambda: runtest_hook(item=item, **kwds), ~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^ File "/opt/conda/envs/py_3.14/lib/python3.14t/site-packages/pluggy/_hooks.py", line 512, in call return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult) ~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/opt/conda/envs/py_3.14/lib/python3.14t/site-packages/pluggy/_manager.py", line 120, in _hookexec return self._inner_hookexec(hook_name, methods, kwargs, firstresult) ~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/opt/conda/envs/py_3.14/lib/python3.14t/site-packages/pluggy/_callers.py", line 167, in _multicall raise exception File "/opt/conda/envs/py_3.14/lib/python3.14t/site-packages/pluggy/_callers.py", line 139, in _multicall teardown.throw(exception) ~~~~~~~~~~~~~~^^^^^^^^^^^ File "/opt/conda/envs/py_3.14/lib/python3.14t/site-packages/_pytest/logging.py", line 850, in pytest_runtest_call yield File "/opt/conda/envs/py_3.14/lib/python3.14t/site-packages/pluggy/_callers.py", line 139, in _multicall teardown.throw(exception) ~~~~~~~~~~~~~~^^^^^^^^^^^ File "/opt/conda/envs/py_3.14/lib/python3.14t/site-packages/_pytest/capture.py", line 900, in pytest_runtest_call return (yield) ^^^^^ File "/opt/conda/envs/py_3.14/lib/python3.14t/site-packages/pluggy/_callers.py", line 139, in _multicall teardown.throw(exception) ~~~~~~~~~~~~~~^^^^^^^^^^^ File "/opt/conda/envs/py_3.14/lib/python3.14t/site-packages/pluggy/_callers.py", line 53, in run_old_style_hookwrapper return result.get_result() ~~~~~~~~~~~~~~~~~^^ File "/opt/conda/envs/py_3.14/lib/python3.14t/site-packages/pluggy/_result.py", line 103, in get_result raise exc.with_traceback(tb) File "/opt/conda/envs/py_3.14/lib/python3.14t/site-packages/pluggy/_callers.py", line 38, in run_old_style_hookwrapper res = yield ^^^^^ File "/opt/conda/envs/py_3.14/lib/python3.14t/site-packages/pluggy/_callers.py", line 139, in _multicall teardown.throw(exception) ~~~~~~~~~~~~~~^^^^^^^^^^^ File "/opt/conda/envs/py_3.14/lib/python3.14t/site-packages/_pytest/skipping.py", line 268, in pytest_runtest_call return (yield) ^^^^^ File "/opt/conda/envs/py_3.14/lib/python3.14t/site-packages/pluggy/_callers.py", line 121, in _multicall res = hook_impl.function(*args) File "/opt/conda/envs/py_3.14/lib/python3.14t/site-packages/_pytest/unraisableexception.py", line 158, in pytest_runtest_call collect_unraisable(item.config) ~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^ File "/opt/conda/envs/py_3.14/lib/python3.14t/site-packages/_pytest/unraisableexception.py", line 79, in collect_unraisable raise errors[0] RuntimeError: Failed to process unraisable exception

Root Cause

This test was disabled because it is failing in CI. See recent examples and the most recent trunk workflow logs.

Code Example

Traceback (most recent call last):
  File "/opt/conda/envs/py_3.14/lib/python3.14t/site-packages/_pytest/unraisableexception.py", line 117, in unraisable_hook
    traceback.format_exception(
    ~~~~~~~~~~~~~~~~~~~~~~~~~~^
        unraisable.exc_type,
        ^^^^^^^^^^^^^^^^^^^^
        unraisable.exc_value,
        ^^^^^^^^^^^^^^^^^^^^^
        unraisable.exc_traceback,
        ^^^^^^^^^^^^^^^^^^^^^^^^^
    )
    ^
RecursionError: maximum recursion depth exceeded

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "/opt/conda/envs/py_3.14/lib/python3.14t/site-packages/_pytest/runner.py", line 353, in from_call
    result: TResult | None = func()
                             ~~~~^^
  File "/opt/conda/envs/py_3.14/lib/python3.14t/site-packages/_pytest/runner.py", line 245, in <lambda>
    lambda: runtest_hook(item=item, **kwds),
            ~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^
  File "/opt/conda/envs/py_3.14/lib/python3.14t/site-packages/pluggy/_hooks.py", line 512, in __call__
    return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult)
           ~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/opt/conda/envs/py_3.14/lib/python3.14t/site-packages/pluggy/_manager.py", line 120, in _hookexec
    return self._inner_hookexec(hook_name, methods, kwargs, firstresult)
           ~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/opt/conda/envs/py_3.14/lib/python3.14t/site-packages/pluggy/_callers.py", line 167, in _multicall
    raise exception
  File "/opt/conda/envs/py_3.14/lib/python3.14t/site-packages/pluggy/_callers.py", line 139, in _multicall
    teardown.throw(exception)
    ~~~~~~~~~~~~~~^^^^^^^^^^^
  File "/opt/conda/envs/py_3.14/lib/python3.14t/site-packages/_pytest/logging.py", line 850, in pytest_runtest_call
    yield
  File "/opt/conda/envs/py_3.14/lib/python3.14t/site-packages/pluggy/_callers.py", line 139, in _multicall
    teardown.throw(exception)
    ~~~~~~~~~~~~~~^^^^^^^^^^^
  File "/opt/conda/envs/py_3.14/lib/python3.14t/site-packages/_pytest/capture.py", line 900, in pytest_runtest_call
    return (yield)
            ^^^^^
  File "/opt/conda/envs/py_3.14/lib/python3.14t/site-packages/pluggy/_callers.py", line 139, in _multicall
    teardown.throw(exception)
    ~~~~~~~~~~~~~~^^^^^^^^^^^
  File "/opt/conda/envs/py_3.14/lib/python3.14t/site-packages/pluggy/_callers.py", line 53, in run_old_style_hookwrapper
    return result.get_result()
           ~~~~~~~~~~~~~~~~~^^
  File "/opt/conda/envs/py_3.14/lib/python3.14t/site-packages/pluggy/_result.py", line 103, in get_result
    raise exc.with_traceback(tb)
  File "/opt/conda/envs/py_3.14/lib/python3.14t/site-packages/pluggy/_callers.py", line 38, in run_old_style_hookwrapper
    res = yield
          ^^^^^
  File "/opt/conda/envs/py_3.14/lib/python3.14t/site-packages/pluggy/_callers.py", line 139, in _multicall
    teardown.throw(exception)
    ~~~~~~~~~~~~~~^^^^^^^^^^^
  File "/opt/conda/envs/py_3.14/lib/python3.14t/site-packages/_pytest/skipping.py", line 268, in pytest_runtest_call
    return (yield)
            ^^^^^
  File "/opt/conda/envs/py_3.14/lib/python3.14t/site-packages/pluggy/_callers.py", line 121, in _multicall
    res = hook_impl.function(*args)
  File "/opt/conda/envs/py_3.14/lib/python3.14t/site-packages/_pytest/unraisableexception.py", line 158, in pytest_runtest_call
    collect_unraisable(item.config)
    ~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^
  File "/opt/conda/envs/py_3.14/lib/python3.14t/site-packages/_pytest/unraisableexception.py", line 79, in collect_unraisable
    raise errors[0]
RuntimeError: Failed to process unraisable exception
RAW_BUFFERClick to expand / collapse

Platforms: linux

This test was disabled because it is failing in CI. See recent examples and the most recent trunk workflow logs.

Over the past 6 hours, it has been determined flaky in 7 workflow(s) with 8 failures and 7 successes.

Debugging instructions (after clicking on the recent samples link): DO NOT ASSUME THINGS ARE OKAY IF THE CI IS GREEN. We now shield flaky tests from developers so CI will thus be green but it will be harder to parse the logs. To find relevant log snippets:

  1. Click on the workflow logs linked above
  2. Click on the Test step of the job so that it is expanded. Otherwise, the grepping will not work.
  3. Grep for test_threaded_weak_key_dict_copy
  4. There should be several instances run (as flaky tests are rerun in CI) from which you can study the logs.
<details><summary>Sample error message</summary>
Traceback (most recent call last):
  File "/opt/conda/envs/py_3.14/lib/python3.14t/site-packages/_pytest/unraisableexception.py", line 117, in unraisable_hook
    traceback.format_exception(
    ~~~~~~~~~~~~~~~~~~~~~~~~~~^
        unraisable.exc_type,
        ^^^^^^^^^^^^^^^^^^^^
        unraisable.exc_value,
        ^^^^^^^^^^^^^^^^^^^^^
        unraisable.exc_traceback,
        ^^^^^^^^^^^^^^^^^^^^^^^^^
    )
    ^
RecursionError: maximum recursion depth exceeded

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "/opt/conda/envs/py_3.14/lib/python3.14t/site-packages/_pytest/runner.py", line 353, in from_call
    result: TResult | None = func()
                             ~~~~^^
  File "/opt/conda/envs/py_3.14/lib/python3.14t/site-packages/_pytest/runner.py", line 245, in <lambda>
    lambda: runtest_hook(item=item, **kwds),
            ~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^
  File "/opt/conda/envs/py_3.14/lib/python3.14t/site-packages/pluggy/_hooks.py", line 512, in __call__
    return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult)
           ~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/opt/conda/envs/py_3.14/lib/python3.14t/site-packages/pluggy/_manager.py", line 120, in _hookexec
    return self._inner_hookexec(hook_name, methods, kwargs, firstresult)
           ~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/opt/conda/envs/py_3.14/lib/python3.14t/site-packages/pluggy/_callers.py", line 167, in _multicall
    raise exception
  File "/opt/conda/envs/py_3.14/lib/python3.14t/site-packages/pluggy/_callers.py", line 139, in _multicall
    teardown.throw(exception)
    ~~~~~~~~~~~~~~^^^^^^^^^^^
  File "/opt/conda/envs/py_3.14/lib/python3.14t/site-packages/_pytest/logging.py", line 850, in pytest_runtest_call
    yield
  File "/opt/conda/envs/py_3.14/lib/python3.14t/site-packages/pluggy/_callers.py", line 139, in _multicall
    teardown.throw(exception)
    ~~~~~~~~~~~~~~^^^^^^^^^^^
  File "/opt/conda/envs/py_3.14/lib/python3.14t/site-packages/_pytest/capture.py", line 900, in pytest_runtest_call
    return (yield)
            ^^^^^
  File "/opt/conda/envs/py_3.14/lib/python3.14t/site-packages/pluggy/_callers.py", line 139, in _multicall
    teardown.throw(exception)
    ~~~~~~~~~~~~~~^^^^^^^^^^^
  File "/opt/conda/envs/py_3.14/lib/python3.14t/site-packages/pluggy/_callers.py", line 53, in run_old_style_hookwrapper
    return result.get_result()
           ~~~~~~~~~~~~~~~~~^^
  File "/opt/conda/envs/py_3.14/lib/python3.14t/site-packages/pluggy/_result.py", line 103, in get_result
    raise exc.with_traceback(tb)
  File "/opt/conda/envs/py_3.14/lib/python3.14t/site-packages/pluggy/_callers.py", line 38, in run_old_style_hookwrapper
    res = yield
          ^^^^^
  File "/opt/conda/envs/py_3.14/lib/python3.14t/site-packages/pluggy/_callers.py", line 139, in _multicall
    teardown.throw(exception)
    ~~~~~~~~~~~~~~^^^^^^^^^^^
  File "/opt/conda/envs/py_3.14/lib/python3.14t/site-packages/_pytest/skipping.py", line 268, in pytest_runtest_call
    return (yield)
            ^^^^^
  File "/opt/conda/envs/py_3.14/lib/python3.14t/site-packages/pluggy/_callers.py", line 121, in _multicall
    res = hook_impl.function(*args)
  File "/opt/conda/envs/py_3.14/lib/python3.14t/site-packages/_pytest/unraisableexception.py", line 158, in pytest_runtest_call
    collect_unraisable(item.config)
    ~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^
  File "/opt/conda/envs/py_3.14/lib/python3.14t/site-packages/_pytest/unraisableexception.py", line 79, in collect_unraisable
    raise errors[0]
RuntimeError: Failed to process unraisable exception
</details>

Test file path: test_weak.py

For all disabled tests (by GitHub issue), see https://hud.pytorch.org/disabled.

cc @ezyang @eellison @bdhirsh @bobrenjc93 @aorenste

extent analysis

TL;DR

The test test_threaded_weak_key_dict_copy is failing due to a RecursionError: maximum recursion depth exceeded, indicating a potential infinite recursion issue.

Guidance

  • Review the test case in test_weak.py to identify the source of the recursion.
  • Check the workflow logs for patterns or clues that might indicate what's causing the infinite recursion.
  • Consider adding logging or debugging statements to the test case to gather more information about the recursion.
  • Look for any recent changes to the code that might have introduced the recursion issue.

Example

No specific code example can be provided without more context, but the test case in test_weak.py should be reviewed for any potential recursive function calls that are not properly terminated.

Notes

The provided error message suggests a RecursionError, but the root cause of the issue is still unclear. Further investigation is needed to determine the exact source of the problem.

Recommendation

Apply a workaround by re-enabling the test and adding additional logging or debugging statements to gather more information about the recursion issue, in order to better understand and fix the root cause.

Vote matrix · Quick signals

Works
Did the solution work? Tap to confirm.
Easy Fix
Was it a quick fix?
Time Saver
Did it save you time?
Blocking
Was it severely blocking?
Common Issue
Are others likely hitting this too?
Flaky / Intermittent
Is it intermittent?
Verified / Reproducible
Can you reproduce it reliably?
Loading…

Still need to ship something?

×6

Another batch ranked right after the header list — different links, same matching logic.

Back to top recommendations

TRENDING

pytorch - 💡(How to fix) Fix DISABLED test_threaded_weak_key_dict_copy (__main__.WeakTest) [2 comments, 1 participants]