python / python/cpython

test_timerfd_initval fails with large time difference on NetBSD

未關閉
#131,266 5 則留言 0 個 reaction 已指派 0 人 在 GitHub 檢視

還沒有人認領這個 Issue。

3.13 3.14 3.15 OS-netbsd tests type-bug
主要語言
Python
星號
77.2k
分支
36k
PR 合併指標
PR 指標待擷取

描述

Bug report

Bug description:

The test_timerfd_initval test in test_os.TimerfdTests is failing on NetBSD with a very large time difference between the expected and actual expiration values. The test expects values to be almost equal within 3 decimal places, but the actual difference is over 1.7 billion seconds.

Configuration:
./configure --with-pydebug
Test
./python -m test test_os -m test_timerfd_initval -v

Output:

== CPython 3.14.0a6+ (heads/main:26511993e63, Mar 15 2025, 01:30:33) [GCC 10.5.0]
== NetBSD-10.0-amd64-x86_64-64bit-ELF little-endian
== Python build: debug
== cwd: /home/blue/cpython/build/test_python_worker_20567æ
== CPU count: 16
== encodings: locale=UTF-8 FS=utf-8
== resources: all test resources are disabled, use -u option to unskip tests
Using random seed: 3011250179
0:00:00 load avg: 2.25 Run 1 test sequentially in a single process
0:00:00 load avg: 2.25 [1/1] test_os
test_timerfd_initval (test.test_os.TimerfdTests.test_timerfd_initval) ... FAIL
======================================================================
FAIL: test_timerfd_initval (test.test_os.TimerfdTests.test_timerfd_initval)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/home/blue/cpython/Lib/test/test_os.py", line 4327, in test_timerfd_initval
    self.assertAlmostEqual(next_expiration, initial_expiration, places=self.CLOCK_RES_PLACES)
    ~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
AssertionError: 1741991497.5326333 != 0.25 within 3 places (1741991497.2826333 difference)
----------------------------------------------------------------------
Ran 1 test in 0.010s
FAILED (failures=1)
test test_os failed
0:00:00 load avg: 2.25 [1/1/1] test_os failed (1 failure)
== Tests result: FAILURE ==
1 test failed:
    test_os
Total duration: 958 ms
Total tests: run=1 (filtered) failures=1
Total test files: run=1/1 (filtered) failed=1
Result: FAILURE

OS: NetBSD-10.0-amd64

CPython versions tested on:

CPython main branch, 3.14, 3.13

Operating systems tested on:

Other

貢獻指南

開啟貢獻指南

從這裡開始

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

研究方向

從 Lib/test/test_os.py 和 TimerfdTests.test_timerfd_initval 開始,然後在具有所回報設定的 NetBSD 上執行 ./python -m test test_os -m test_timerfd_initval -v。比較預期與實際的計時器到期值,並調查 NetBSD 特有的行為;受影響平台上的測試正確通過即表示完成。

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

評估

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

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

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