python / python/cpython

test_perf_profiler: race condition when cleaning up perf-*.map files

オープン
#141,592 コメント 2 件 リアクション 0 件 担当者 0 名 GitHub で見る

まだ誰も着手していません。

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 testrace condition.

This causes:

  • Flaky test failures
  • Leftover /tmp/perf-*.map files
  • 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

コントリビューションガイド

コントリビューションガイドを開く

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

調査の方向性

Lib/test/test_perf_profiler.pyから始め、setUpとtearDownによる/tmp内のperf-*.mapファイルの処理に注目してください。利用可能であればテストを並列実行し、ファイルがどのように作成およびクリーンアップされるかを調べてください。各テストが自分で作成したmapファイルだけを削除し、並行して実行されているテストに属するファイルを削除しなければ完了です。

索引モデルが issue の本文から書いたものです。

評価

技術スタック
python
領域
testing-qa
issue の種類
バグ
難易度
3/5
見積もり時間
1〜2日
活発さ
停滞
明瞭さ
明確に書かれている
初心者へのやさしさ
25/100

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。