test_socketserver.test_UnixDatagramServer() times out on GHA iOS CI
Bug report
Bug description:
Example: https://github.com/python/cpython/actions/runs/18868398194/job/53840759567?pr=140558
====================================================================== ERROR: test_UnixDatagramServer (test.test_socketserver.SocketServerTest.test_UnixDatagramServer) ---------------------------------------------------------------------- Traceback (most recent call last): File "/Users/runner/Library/Developer/CoreSimulator/Devices/7EDFF154-B6AB-44D3-BA15-EBE53F1F1878/data/Containers/Bundle/Application/F7FB9E8B-0A4F-4BDD-A041-3CB5C1B883AE/iOSTestbed.app/python/lib/python3.15/test/test_socketserver.py", line 227, in test_UnixDatagramServer self.run_server(socketserver.UnixDatagramServer, ~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ socketserver.DatagramRequestHandler, ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ self.dgram_examine) ^^^^^^^^^^^^^^^^^^^ File "/Users/runner/Library/Developer/CoreSimulator/Devices/7EDFF154-B6AB-44D3-BA15-EBE53F1F1878/data/Containers/Bundle/Application/F7FB9E8B-0A4F-4BDD-A041-3CB5C1B883AE/iOSTestbed.app/python/lib/python3.15/test/support/threading_helper.py", line 66, in decorator return func(*args) File "/Users/runner/Library/Developer/CoreSimulator/Devices/7EDFF154-B6AB-44D3-BA15-EBE53F1F1878/data/Containers/Bundle/Application/F7FB9E8B-0A4F-4BDD-A041-3CB5C1B883AE/iOSTestbed.app/python/lib/python3.15/test/test_socketserver.py", line 135, in run_server testfunc(svrcls.address_family, addr) ~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/Users/runner/Library/Developer/CoreSimulator/Devices/7EDFF154-B6AB-44D3-BA15-EBE53F1F1878/data/Containers/Bundle/Application/F7FB9E8B-0A4F-4BDD-A041-3CB5C1B883AE/iOSTestbed.app/python/lib/python3.15/test/test_socketserver.py", line 162, in dgram_examine buf = data = receive(s, 100) ~~~~~~~^^^^^^^^ File "/Users/runner/Library/Developer/CoreSimulator/Devices/7EDFF154-B6AB-44D3-BA15-EBE53F1F1878/data/Containers/Bundle/Application/F7FB9E8B-0A4F-4BDD-A041-3CB5C1B883AE/iOSTestbed.app/python/lib/python3.15/test/test_socketserver.py", line 44, in receive raise RuntimeError("timed out on %r" % (sock,)) RuntimeError: timed out on <socket.socket fd=33, family=1, type=2, proto=0, laddr=./test_python_x3rw1qn_.sock>
The function uses test.support.SHORT_TIMEOUT which is 30 seconds by default:
def receive(sock, n, timeout=test.support.SHORT_TIMEOUT): r, w, x = _real_select([sock], [], [], timeout) if sock in r: return sock.recv(n) else: raise RuntimeError("timed out on %r" % (sock,))
CPython versions tested on:
CPython main branch
Operating systems tested on:
Other
Linked PRs
- gh-140702: Diagnose iOS datagram timeout bug #140736
- gh-140702: Add test skip for Unix Datagram tests on iOS when on Github Actions #140740
- [3.14] gh-140702: Add test skip for Unix Datagram tests on iOS when on Github Actions (GH-140740) #140742
- gh-140702: Log color and GHA env vars in test.pythoninfo #140747
- [3.14] gh-140702: Log color and GHA env vars in test.pythoninfo (GH-140747) #140753
- [3.13] gh-140702: Log color and GHA env vars in test.pythoninfo (GH-140747) #140754