python / python/cpython

In `test._test_multiprocessing` file, `HAVE_GETVALUE` constant is always `False`

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

還沒有人認領這個 Issue。

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

描述

Bug report

Bug description:

In the test._test_multprocessing, the HAVE_GETVALUE constant is always False because the HAVE_BROKEN_SEM_GETVALUE value does not exist in _multiprocessingmodule.

https://github.com/python/cpython/blob/6f7fb6c95ba9e4d5c1b86d0d4ad83d0cd495976b/Lib/test/_test_multiprocessing.py#L141-L142

On macOS, this value exists only in the flagsdict of _multiprocessing.

>>> import _mulitpocessing
>>> vars(_multiprocessing)
{'__name__': '_multiprocessing', '__doc__': None, '__package__': '', 
'__loader__':  ............ ,
.......
'SemLock': <class '_multiprocessing.SemLock'>,
'flags': {'HAVE_SEM_OPEN': 1, 'HAVE_BROKEN_SEM_GETVALUE': 1}}

Fix is easy and will permit to reactivate the second part of test_bounded_semaphore test.
https://github.com/python/cpython/blob/6f7fb6c95ba9e4d5c1b86d0d4ad83d0cd495976b/Lib/test/_test_multiprocessing.py#L1755-L1757

A new PR will be submitted soon.

CPython versions tested on:

CPython main branch

Operating systems tested on:

macOS, Linux

Linked PRs
  • gh-155540

貢獻指南

開啟貢獻指南

從這裡開始

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

研究方向

從 Lib/test/_test_multiprocessing.py 中 HAVE_GETVALUE 的定義和 test_bounded_semaphore 開始。檢查 _multiprocessing 在 macOS 上如何公開其 flags,然後執行相關的 multiprocessing 測試。完成的標準是 HAVE_GETVALUE 反映平台值,且 test_bounded_semaphore 的第二部分處於啟用狀態並通過測試。

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

評估

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

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

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