python / python/cpython

AssertionError in test.test_multiprocessing_spawn.test_processes.WithProcessesTestProcess.test_interrupt

未关闭
#133,651 1 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看

还没有人认领这个 Issue。

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

描述

Bug report

Bug description:

I try to build Python 3.14.0b1 on Fedora Linux 42, 41, 40, the test has failed so far (the list is incomplete) for debug and freethreading-debug builds, on x86_64, i686, aarch64 arches. Traceback is in all cases similar with the difference of pipe_handle argument value.

Re-running test.test_multiprocessing_spawn.test_processes in verbose mode (matching: test_interrupt)
test_interrupt (test.test_multiprocessing_spawn.test_processes.WithProcessesTestProcess.test_interrupt) ... Traceback (most recent call last):
  File "<string>", line 1, in <module>
    from multiprocessing.spawn import spawn_main; spawn_main(tracker_fd=5, pipe_handle=7)
                                                  ~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/builddir/build/BUILD/Python-3.14.0b1/Lib/multiprocessing/spawn.py", line 122, in spawn_main
    exitcode = _main(fd, parent_sentinel)
  File "/builddir/build/BUILD/Python-3.14.0b1/Lib/multiprocessing/spawn.py", line 131, in _main
    prepare(preparation_data)
    ~~~~~~~^^^^^^^^^^^^^^^^^^
  File "/builddir/build/BUILD/Python-3.14.0b1/Lib/multiprocessing/spawn.py", line 244, in prepare
    _fixup_main_from_name(data['init_main_from_name'])
    ~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/builddir/build/BUILD/Python-3.14.0b1/Lib/multiprocessing/spawn.py", line 268, in _fixup_main_from_name
    main_content = runpy.run_module(mod_name,
                                    run_name="__mp_main__",
                                    alter_sys=True)
  File "/builddir/build/BUILD/Python-3.14.0b1/Lib/runpy.py", line 226, in run_module
    return _run_module_code(code, init_globals, run_name, mod_spec)
  File "/builddir/build/BUILD/Python-3.14.0b1/Lib/runpy.py", line 98, in _run_module_code
    _run_code(code, mod_globals, init_globals,
    ~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
              mod_name, mod_spec, pkg_name, script_name)
              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/builddir/build/BUILD/Python-3.14.0b1/Lib/runpy.py", line 88, in _run_code
    exec(code, run_globals)
    ~~~~^^^^^^^^^^^^^^^^^^^
  File "/builddir/build/BUILD/Python-3.14.0b1/Lib/test/libregrtest/worker.py", line 8, in <module>
    from .setup import setup_process, setup_test_dir
  File "/builddir/build/BUILD/Python-3.14.0b1/Lib/test/libregrtest/setup.py", line 12, in <module>
    from .runtests import RunTests
  File "/builddir/build/BUILD/Python-3.14.0b1/Lib/test/libregrtest/runtests.py", line 194, in <module>
    @dataclasses.dataclass(slots=True, frozen=True)
     ~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/builddir/build/BUILD/Python-3.14.0b1/Lib/dataclasses.py", line 1362, in wrap
    return _process_class(cls, init, repr, eq, order, unsafe_hash,
                          frozen, match_args, kw_only, slots,
                          weakref_slot)
  File "/builddir/build/BUILD/Python-3.14.0b1/Lib/dataclasses.py", line 1163, in _process_class
    func_builder.add_fns_to_class(cls)
    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^^^^^
  File "/builddir/build/BUILD/Python-3.14.0b1/Lib/dataclasses.py", line 507, in add_fns_to_class
    fns = ns['__create_fn__'](**self.locals)
  File "<string>", line 28, in __create_fn__
  File "/builddir/build/BUILD/Python-3.14.0b1/Lib/reprlib.py", line 32, in decorating_function
    wrapper.__type_params__ = getattr(user_function, '__type_params__', ())
                              ~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
KeyboardInterrupt
FAIL
======================================================================
FAIL: test_interrupt (test.test_multiprocessing_spawn.test_processes.WithProcessesTestProcess.test_interrupt)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/builddir/build/BUILD/Python-3.14.0b1/Lib/test/_test_multiprocessing.py", line 578, in test_interrupt
    self.assertEqual(exitcode, 1)
    ~~~~~~~~~~~~~~~~^^^^^^^^^^^^^
AssertionError: -2 != 1
CPython versions tested on:

3.14

Operating systems tested on:

Linux

贡献指南

打开贡献指南

从这里开始

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

调研方向

从 Lib/test/_test_multiprocessing.py 中的 test.test_multiprocessing_spawn.test_processes.WithProcessesTestProcess.test_interrupt 开始,并在受影响的 Linux debug 或 freethreading-debug 构建中重现该问题。通过 Lib/multiprocessing/spawn.py 以及 Lib/test/libregrtest/runtests.py 和 Lib/reprlib.py 中的 dataclass 路径跟踪生成的进程;当测试在报告的各个配置下以预期的退出代码完成时,即视为完成。

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

评估

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

把新 issue 发到你的邮箱

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