python / python/cpython

regrtest: Only report a leak if all test runs leak at least one file descriptor

未關閉
#157,628 0 則留言 0 個 reaction 已指派 0 人 在 GitHub 檢視

還沒有人認領這個 Issue。

tests type-feature
主要語言
Python
星號
77.2k
分支
36k
PR 合併指標
PR 指標待擷取

描述

Example on a recent buildbot run on AMD64 CentOS9 NoGIL Refleaks 3.x: https://buildbot.python.org/#/builders/1610/builds/4004

test_free_threading leaked [0, 1, 0] references, sum=1 (this is fine)
test_free_threading leaked [0, 1, -1] file descriptors, sum=0

For references, regrtest considers that a test leaks only if all test runs leak at least 1 reference.

For file descriptors, regrtest considers that a test leaks if at least one test run leaks a file descriptor.

In this example, leaked [0, 1, -1] file descriptors, sum=0 says that a test run creates a file descriptor without closing it (first run test, after the warmup): delta +1, but the following test run closes the file descriptor: delta -1. The sum=0 says that there is no leak at the end, all created file descriptors have been closed.

I propose to change the leak detection to only consider that there is a leak if all test runs leak at least one file descriptors.

Linked PRs
  • gh-157629
  • gh-157753

貢獻指南

開啟貢獻指南

從這裡開始

  1. 先讀完整個 Issue,再讀專案的貢獻指南。
  2. 在 Issue 下留言說明你要接手 —— 這能避免兩個人做同樣的事。
  3. Fork 儲存庫,在一個分支上完成修改。
  4. 送出 Pull Request,並在描述裡引用這個 Issue 編號。

研究方向

先定位 regrtest 的檔案描述元洩漏偵測,並檢視連結的 PR gh-157629 和 gh-157753,了解已在進行的工作。使用 buildbot 範例作為重現案例;完成的條件是,只有在每次測試執行都至少洩漏一個檔案描述元時才回報洩漏。

由索引模型根據 Issue 內容生成。

評估

技術堆疊
python
領域
testing-qa
Issue 類型
缺陷
難度
3/5
預估耗時
1-2 天
活躍度
停滯
描述清晰度
基本清楚
新手友好度
35/100

把新 issue 寄到你的電子郵件信箱

精選適合新手參與的 GitHub issue 摘要。