Hacktoberfest 2026:维护者为十月标记出来的 issue,仍然开放、适合新手。 浏览 Hacktoberfest issue

tests testoutput.py::OutputJSONsuite can be flaky on high-core-count systems

未关闭
#21,905 0 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看

还没有人认领这个 Issue。

评估

难度
4/5
预计耗时
3-5 天
新手友好度
48/100
Issue 类型
缺陷
描述清晰度
基本清楚
活跃度
活跃
技术栈
python
领域
testing

调研方向

从 testoutput.py::OutputJSONsuite 以及 test-data/unit/outputjson.test 第 46 行和第 62 行的用例开始。在多核系统上使用 Python 3.13 或 3.14,通过并行 worker 重现失败,然后跟踪报告的 subprocess 和 build-worker 错误。当这些测试能够稳定通过,且没有 ResourceWarning、CompileError 或 worker 连接失败时,即表示完成。

由索引模型根据 Issue 内容生成。

描述

bug parallel checking topic-developer

Now that Debian is testing mypy with native parsing (via ast-serialize) we resumed running the entire test suite.

With mypy 2.2.0 we see random failures of testoutput.py::OutputJSONsuite::outputjson.test::* on high-core count systems.

Mostly due to ResourceWarning: subprocess 21441 is still running being turned into pytest.PytestUnraisableExceptionWarning: Exception ignored while calling deallocator <function Popen.__del__ at 0x7f30bbe13ed0>: None

But also other errors: mypy.errors.CompileError: {"file": "tmp/main", "line": 2, "column": 0, "end_line": 2, "end_column": 5, "message": "\"break\" outside loop", "hint": null, "code": null, "severity": "error"} and OSError: Cannot connect to build worker(s): 0

Details

Here we had test failures under Python 3.13 and 3.14 https://ci.debian.net/packages/m/mypy/testing/ppc64el/74734444/

2227s =================================== FAILURES ===================================
2227s ____________________________ testOutputJsonParallel ____________________________
2227s [gw10] linux -- Python 3.13.15 /usr/bin/python3.13
2227s data: /tmp/autopkgtest.EyGnnA/build.z2o/src/test-data/unit/outputjson.test:46:
2227s /usr/lib/python3.13/subprocess.py:1140: in __del__
2227s     _warn("subprocess %s is still running" % self.pid,
2227s E   ResourceWarning: subprocess 6479 is still running
2227s 
2227s The above exception was the direct cause of the following exception:
2227s /usr/lib/python3/dist-packages/pluggy/_hooks.py:512: in __call__
2227s     return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult)
2227s            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
2227s /usr/lib/python3/dist-packages/pluggy/_manager.py:120: in _hookexec
2227s     return self._inner_hookexec(hook_name, methods, kwargs, firstresult)
2227s            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
2227s /usr/lib/python3/dist-packages/_pytest/logging.py:865: in pytest_runtest_call
2227s     yield
2227s /usr/lib/python3/dist-packages/_pytest/capture.py:900: in pytest_runtest_call
2227s     return (yield)
2227s             ^^^^^
2227s /usr/lib/python3/dist-packages/_pytest/skipping.py:268: in pytest_runtest_call
2227s     return (yield)
2227s             ^^^^^
2227s /usr/lib/python3/dist-packages/_pytest/unraisableexception.py:183: in pytest_runtest_call
2227s     collect_unraisable(item.config)
2227s /usr/lib/python3/dist-packages/_pytest/unraisableexception.py:79: in collect_unraisable
2227s     raise errors[0]
2227s /usr/lib/python3/dist-packages/_pytest/unraisableexception.py:67: in collect_unraisable
2227s     warnings.warn(pytest.PytestUnraisableExceptionWarning(msg))
2227s E   pytest.PytestUnraisableExceptionWarning: Exception ignored in: <function Popen.__del__ at 0x3fff82b01300>
2227s E   Enable tracemalloc to get traceback where the object was allocated.
2227s E   See https://docs.pytest.org/en/stable/how-to/capture-warnings.html#resource-warnings for more info.
2227s ______________________ testOutputJsonSyntaxErrorParallel _______________________
2227s [gw10] linux -- Python 3.13.15 /usr/bin/python3.13
2227s data: /tmp/autopkgtest.EyGnnA/build.z2o/src/test-data/unit/outputjson.test:62:
2227s mypy/main.py:244: in run_build
2227s     ???
2227s mypy/build.py:422: in build
2227s     result = build_inner(
2227s mypy/build.py:537: in build_inner
2227s     graph = dispatch(sources, manager, stdout, connect_threads)
2227s mypy/build.py:4146: in dispatch
2227s     process_graph(graph, manager)
2227s mypy/build.py:4614: in process_graph
2227s     done, still_working, results = manager.wait_for_done(graph)
2227s mypy/build.py:1480: in wait_for_done
2227s     return self.wait_for_done_workers(graph)
2227s mypy/build.py:1506: in wait_for_done_workers
2227s     raise data.blocker
2227s E   mypy.errors.CompileError: {"file": "tmp/main", "line": 2, "column": 0, "end_line": 2, "end_column": 5, "message": "\"break\" outside loop", "hint": null, "code": null, "severity": "error"}
2227s 
2227s During handling of the above exception, another exception occurred:
2227s /usr/lib/python3.13/subprocess.py:1140: in __del__
2227s     _warn("subprocess %s is still running" % self.pid,
2227s E   ResourceWarning: subprocess 6518 is still running
2227s 
2227s The above exception was the direct cause of the following exception:
2227s /usr/lib/python3/dist-packages/pluggy/_hooks.py:512: in __call__
2227s     return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult)
2227s            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
2227s /usr/lib/python3/dist-packages/pluggy/_manager.py:120: in _hookexec
2227s     return self._inner_hookexec(hook_name, methods, kwargs, firstresult)
2227s            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
2227s /usr/lib/python3/dist-packages/_pytest/logging.py:865: in pytest_runtest_call
2227s     yield
2227s /usr/lib/python3/dist-packages/_pytest/capture.py:900: in pytest_runtest_call
2227s     return (yield)
2227s             ^^^^^
2227s /usr/lib/python3/dist-packages/_pytest/skipping.py:268: in pytest_runtest_call
2227s     return (yield)
2227s             ^^^^^
2227s /usr/lib/python3/dist-packages/_pytest/unraisableexception.py:183: in pytest_runtest_call
2227s     collect_unraisable(item.config)
2227s /usr/lib/python3/dist-packages/_pytest/unraisableexception.py:79: in collect_unraisable
2227s     raise errors[0]
2227s /usr/lib/python3/dist-packages/_pytest/unraisableexception.py:67: in collect_unraisable
2227s     warnings.warn(pytest.PytestUnraisableExceptionWarning(msg))
2227s E   pytest.PytestUnraisableExceptionWarning: Exception ignored in: <function Popen.__del__ at 0x3fff82b01300>
2227s E   Enable tracemalloc to get traceback where the object was allocated.
2227s E   See https://docs.pytest.org/en/stable/how-to/capture-warnings.html#resource-warnings for more info.

More examples:

主要语言
Python
星标
20.6k
派生
3.3k
平均合并
1 天 12 小时
30 天内合并 PR
58

贡献指南

打开贡献指南

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

python/mypy 的其他 Issue

查看 python/mypy 的全部 Issue

相似的 Issue

更多 Python Issue

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。