test_perf_profiler: race condition when cleaning up perf-*.map files
未关闭
还没有人认领这个 Issue。
tests
topic-profiling
type-bug
- 主要语言
- Python
- 星标
- 77.2k
- 派生
- 35.9k
- PR 合并指标
- PR 指标待抓取
描述
Bug report
Bug description:
What happens
Lib/test/test_perf_profiler.py uses setUp/tearDown to record all perf-*.map files in /tmp at test start, then deletes any new ones at the end.
When tests run in parallel (make -j, CI runners, pytest-xdist), one test deletes map files belonging to another test → race condition.
This causes:
- Flaky test failures
- Leftover
/tmp/perf-*.mapfiles - Unreliable CI results
What should happen
Each test should only delete the perf-*.map file(s) it created, regardless of other concurrent processes.
CPython versions tested on:
CPython main branch
Operating systems tested on:
No response
Linked PRs
- gh-141593
贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
调研方向
从 Lib/test/test_perf_profiler.py 开始,重点关注其 setUp 和 tearDown 对 /tmp 中 perf-*.map 文件的处理。如果支持并行执行,请以并行方式运行测试,并检查文件的创建和清理方式。完成的标准是每个测试只删除它创建的 map 文件,而不会删除属于并发测试的文件。
由索引模型根据 Issue 内容生成。
评估
- 技术栈
- python
- 领域
- testing-qa
- Issue 类型
- 缺陷
- 难度
- 3/5
- 预计耗时
- 1-2 天
- 活跃度
- 停滞
- 描述清晰度
- 描述清楚
- 新手友好度
- 25/100