python / python/cpython

Intermittent iOS buildbot failure in test_sock_client_racing

Open
#148,793 4 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

OS-ios tests topic-asyncio type-bug
Dominant language
Python
Stars
77.2k
Forks
35.9k
PR merge metrics
PR metrics pending

Description

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

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with test/test_asyncio/test_sock_lowlevel.py, especially KqueueEventLoopTests.test_sock_client_racing and _basetest_sock_send_racing, then compare the linked iOS buildbot failures and reruns. Done means the test no longer fails intermittently on the iOS buildbot while still detecting genuine socket errors.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
mobile-dev, networking, testing-qa
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Quiet
Clarity
Needs clarification
Newbie friendliness
42/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.