python / python/cpython

Make `test_c_subclass_of_heap_ctype_with_tpdealloc_decrefs_once` and `test_c_subclass_of_heap_ctype_with_del_modifying_dunder_class_only_decrefs_once` behavioral tests

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

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

tests type-refactor
主要言語
Python
スター
77.2k
フォーク
35.9k
PR マージ指標
PR 指標を取得中

説明

Feature or enhancement

Proposal:

The test_c_subclass_of_heap_ctype_with_tpdealloc_decrefs_once and test_c_subclass_of_heap_ctype_with_del_modifying_dunder_class_only_decrefs_once tests were added to verify that we don't decref a type object too many times when destroying an instance of the type in certain scenarios. The tests currently verify this by checking reference counts. This is sensitive to implementation details and likely to break in the future. To make this more robust, we'd like to refactor the tests and supporting C code to verify that we don't crash (a symptom of decrefing too many times).

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

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

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

はじめの一歩

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

調査の方向性

test_c_subclass_of_heap_ctype_with_tpdealloc_decrefs_once と test_c_subclass_of_heap_ctype_with_del_modifying_dunder_class_only_decrefs_once を検索し、その後、これらのテストで使用されている補助 C コードを調査します。テストと C のサポートコードをリファクタリングし、参照カウントを確認するのではなく、シナリオがクラッシュしないことを検証するようにします。影響を受けるテストを実行して、この動作を確認します。

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

評価

技術スタック
c, python
領域
testing
issue の種類
リファクタリング
難易度
3/5
見積もり時間
1〜2日
活発さ
停滞
明瞭さ
おおむね明確
初心者へのやさしさ
45/100

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

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