python / python/cpython

Intermittent iOS buildbot failure in test_sock_client_racing

未关闭
#148,793 4 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看

还没有人认领这个 Issue。

OS-ios tests topic-asyncio type-bug
主要语言
Python
星标
77.2k
派生
35.9k
PR 合并指标
PR 指标待抓取

描述

Bug report

Bug description:

This is failing on about 10% of attempts. Usually it passes on a rerun:

But sometimes it fails on the rerun:

 ERROR: test_sock_client_racing (test.test_asyncio.test_sock_lowlevel.KqueueEventLoopTests.test_sock_client_racing)
 ----------------------------------------------------------------------
 Traceback (most recent call last):
   File "/Users/buildbot/Library/Developer/CoreSimulator/Devices/4F9AFDE7-A49A-46AD-B161-FCA22E48EA55/data/Containers/Bundle/Application/3DAA3568-C09B-454E-9E2B-4749EEB89567/iOSTestbed.app/python/lib/python3.15/test/test_asyncio/test_sock_lowlevel.py", line 273, in test_sock_client_racing
     self.loop.run_until_complete(asyncio.wait_for(
     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^
         self._basetest_sock_send_racing(listener, sock), 10))
         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
   File "/Users/buildbot/Library/Developer/CoreSimulator/Devices/4F9AFDE7-A49A-46AD-B161-FCA22E48EA55/data/Containers/Bundle/Application/3DAA3568-C09B-454E-9E2B-4749EEB89567/iOSTestbed.app/python/lib/python3.15/asyncio/base_events.py", line 724, in run_until_complete
     return future.result()
            ~~~~~~~~~~~~~^^
   File "/Users/buildbot/Library/Developer/CoreSimulator/Devices/4F9AFDE7-A49A-46AD-B161-FCA22E48EA55/data/Containers/Bundle/Application/3DAA3568-C09B-454E-9E2B-4749EEB89567/iOSTestbed.app/python/lib/python3.15/asyncio/tasks.py", line 488, in wait_for
     return await fut
            ^^^^^^^^^
   File "/Users/buildbot/Library/Developer/CoreSimulator/Devices/4F9AFDE7-A49A-46AD-B161-FCA22E48EA55/data/Containers/Bundle/Application/3DAA3568-C09B-454E-9E2B-4749EEB89567/iOSTestbed.app/python/lib/python3.15/test/test_asyncio/test_sock_lowlevel.py", line 196, in _basetest_sock_send_racing
     sock.send(b' ' * size)
     ~~~~~~~~~^^^^^^^^^^^^^
 ConnectionResetError: [Errno 54] Connection reset by peer

@freakboy3742: FYI

CPython versions tested on:

CPython main branch

Operating systems tested on:

Other

贡献指南

打开贡献指南

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

调研方向

从 test/test_asyncio/test_sock_lowlevel.py 开始,重点查看 KqueueEventLoopTests.test_sock_client_racing 和 _basetest_sock_send_racing,然后比较关联的 iOS buildbot 失败记录和重新运行结果。完成的标准是:该测试在 iOS buildbot 上不再间歇性失败,同时仍能检测到真实的 socket 错误。

由索引模型根据 Issue 内容生成。

评估

技术栈
python
领域
mobile-dev, networking, testing-qa
Issue 类型
缺陷
难度
4/5
预计耗时
3-5 天
活跃度
冷清
描述清晰度
需要澄清
新手友好度
42/100

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。