python / python/cpython

Tests fail when `_interpreters` extension is disabled

未关闭
#148,244 24 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看

还没有人认领这个 Issue。

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

描述

Bug report

Bug description:

My CPython version: 3.14.4 (problem with 3.14.3 too)

Configure:
./configure --disable-shared --enable-optimizations --without-lto

Select modules:

./Modules/makesetup -c ./Modules/config.c.in -s ./Modules ./Setup.my.local
mv config.c ./Modules/

File (github says *.local file upload is not expected, change ext txt -> local)
Setup.my.txt
As you can see, the _interpreters module is disabled

And make:
make -j4

Error after testing:

...
File ".../Lib/test/datetimetester.py", line 7304, in test_concurrent_initialization_subinterpreter
...
Traceback (most recent call last):
  File "<string>", line 2, in <module>
    from concurrent.futures import InterpreterPoolExecutor
ImportError: cannot import name 'InterpreterPoolExecutor' from 'concurrent.futures'
...
Ran 1098 tests in 10.101s

FAILED (failures=1, skipped=53)
test test_datetime failed
make: *** [Makefile:990: profile-run-stamp] Error 2

I think a test with a non-existent module should be skipped, not crashed
Also, why does a test failure cause the build to fail if these tests are just needed to collect statistics?

CPython versions tested on:

3.14

Operating systems tested on:

Linux

贡献指南

打开贡献指南

从这里开始

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

调研方向

从 Lib/test/datetimetester.py 中 test_concurrent_initialization_subinterpreter 附近开始,检查 concurrent.futures.InterpreterPoolExecutor 如何依赖 _interpreters 扩展。禁用 _interpreters 后运行受影响的测试,然后验证不可用的功能是否按预期处理,并确认 profile-run 测试命令在没有此失败的情况下完成。

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

评估

技术栈
python
领域
build-system, testing-qa
Issue 类型
缺陷
难度
3/5
预计耗时
1-2 天
活跃度
冷清
描述清晰度
基本清楚
新手友好度
62/100

把新 issue 发到你的邮箱

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