python / python/cpython

`test_multiprocessing_spawn.test_processes` flaky tests on Windows

未关闭
#130,733 6 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看

还没有人认领这个 Issue。

OS-windows tests topic-multiprocessing type-bug
主要语言
Python
星标
77.2k
派生
36k
PR 合并指标
PR 指标待抓取

描述

Bug report

Seen on Windows free threading build, but not free threading specific:

https://github.com/python/cpython/actions/runs/13606907022/job/38039459160?pr=130732

This is in Windows specific code. Not yet sure if this is free threading specific.

ERROR: test_async_error_callback (test.test_multiprocessing_spawn.test_processes.WithProcessesTestPoolWorkerErrors.test_async_error_callback)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "D:\a\cpython\cpython\Lib\test\_test_multiprocessing.py", line 3101, in test_async_error_callback
    p.close()
    ~~~~~~~^^
  File "D:\a\cpython\cpython\Lib\multiprocessing\pool.py", line 652, in close
    self._change_notifier.put(None)
    ~~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^
  File "D:\a\cpython\cpython\Lib\multiprocessing\queues.py", line 394, in put
    self._writer.send_bytes(obj)
    ~~~~~~~~~~~~~~~~~~~~~~~^^^^^
  File "D:\a\cpython\cpython\Lib\multiprocessing\connection.py", line 206, in send_bytes
    self._send_bytes(m[offset:offset + size])
    ~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^
  File "D:\a\cpython\cpython\Lib\multiprocessing\connection.py", line 293, in _send_bytes
    raise ValueError("concurrent send_bytes() calls "
                     "are not supported")
ValueError: concurrent send_bytes() calls are not supported
Also `test_traceback`:
ERROR: test_traceback (test.test_multiprocessing_spawn.test_processes.WithProcessesTestPool.test_traceback)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "D:\a\cpython\cpython\Lib\test\_test_multiprocessing.py", line 2974, in test_traceback
    with self.Pool(1) as p:
         ~~~~~~~~~^^^
  File "D:\a\cpython\cpython\Lib\multiprocessing\pool.py", line 739, in __exit__
    self.terminate()
    ~~~~~~~~~~~~~~^^
  File "D:\a\cpython\cpython\Lib\multiprocessing\pool.py", line 657, in terminate
    self._terminate()
    ~~~~~~~~~~~~~~~^^
  File "D:\a\cpython\cpython\Lib\multiprocessing\util.py", line 216, in __call__
    res = self._callback(*self._args, **self._kwargs)
  File "D:\a\cpython\cpython\Lib\multiprocessing\pool.py", line 690, in _terminate_pool
    change_notifier.put(None)
    ~~~~~~~~~~~~~~~~~~~^^^^^^
  File "D:\a\cpython\cpython\Lib\multiprocessing\queues.py", line 394, in put
    self._writer.send_bytes(obj)
    ~~~~~~~~~~~~~~~~~~~~~~~^^^^^
  File "D:\a\cpython\cpython\Lib\multiprocessing\connection.py", line 206, in send_bytes
    self._send_bytes(m[offset:offset + size])
    ~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^
  File "D:\a\cpython\cpython\Lib\multiprocessing\connection.py", line 293, in _send_bytes
    raise ValueError("concurrent send_bytes() calls "
                     "are not supported")
ValueError: concurrent send_bytes() calls are not supported

贡献指南

打开贡献指南

从这里开始

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

调研方向

从 test.test_multiprocessing_spawn.test_processes 和 Lib/test/_test_multiprocessing.py 中失败的用例开始,然后通过 Lib/multiprocessing/pool.py、queues.py 和 connection.py 跟踪 Windows 失败。 在 Windows 上重现这些失败,并确定为什么会发生并发的 send_bytes 调用;完成的标准是受影响的测试不再间歇性失败,并且该行为由适当的测试覆盖。

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

评估

技术栈
python
领域
operating-systems, testing-qa
Issue 类型
缺陷
难度
4/5
预计耗时
3-5 天
活跃度
停滞
描述清晰度
需要澄清
新手友好度
35/100

把新 issue 发到你的邮箱

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