Make Memory-Related Tests Less Fragile
まだ誰も着手していません。
- 主要言語
- Python
- スター
- 77.2k
- フォーク
- 35.9k
- PR マージ指標
- PR 指標を取得中
説明
Feature or enhancement
Proposal:
There are a number of tests that check various aspects of memory management, typically related to some specific module or feature. Nearly every one of these tests is fairly tightly coupled to the fine details of our memory management implementation, usually tied to specific numbers.
This makes the tests fragile, often breaking with even slight changes to some aspect of memory management. [^1]
[^1]: To be fair, we don't make changes to memory management very often; clearly these tests aren't breaking all the time.
For example, in https://github.com/python/cpython/pull/121134#issuecomment-2233412265, @Fidget-Spinner says:
It fails
test.test_gdb.test_pretty_print test_capi test_exceptions test_regrtest test_repl test_sys test_tracemallocmainly because they count allocations/test out of memory situations, and the hashtable adds random allocations which breaks their careful calculations.
[^2]
[^2]: Note that those aren't necessarily the only tests that need attention here.
Ideally, we would find a way to make such tests less coupled to specific numbers, without sacrificing the accuracy of the behavior checks they are making.
Has this already been discussed elsewhere?
This is a minor feature, which does not need previous discussion elsewhere
Links to previous discussion of this feature:
No response
コントリビューションガイド
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
調査の方向性
まず、issue で指定されているメモリ依存のテストを確認します: test_gdb.test_pretty_print、test_capi、test_exceptions、test_regrtest、test_repl、test_sys、test_tracemalloc。どのアロケーションまたはメモリ不足のアサーションが固定値に依存しているかを特定し、その後、それらの正確な数値なしでも動作のチェックを正確に保つ方法を判断します。影響を受けるテストが関連するメモリ管理の変更に耐えながら、引き続きリグレッションを検出できれば完了です。
索引モデルが issue の本文から書いたものです。
評価
- 技術スタック
- python
- 領域
- testing-qa
- issue の種類
- 機能追加
- 難易度
- 5/5
- 見積もり時間
- 1週間以上
- 活発さ
- 停滞
- 明瞭さ
- 説明が足りない
- 初心者へのやさしさ
- 25/100