Repository navigation
ci: PyPy 3.11 macOS TLS tests intermittently fail in _cffi_ssl #1077
Description
Problem
The macOS Intel wheel job intermittently fails in the final pp311-macosx_x86_64 test phase. All 23 TLS-resumption tests fail after PyPy's bundled _cffi_ssl interprets size_t[1] as a char array.
This blocks otherwise green pull requests. The same failure has reproduced on unrelated branches, while nearby runs with the same runner image, PyPy build, and dependency versions pass.
Environment
- GitHub runner:
macos-15-intel - Python: 3.11.15
- PyPy: 7.3.23
- cibuildwheel: 4.2.1
- pip: 26.2.1
- cryptography: 50.0.2
- pytest: 9.1.1
Failure signature
tests/unit/test_tls_resumption.py:130:
self._socket.sendall(b'ping')
.../lib/pypy3.11/_cffi_ssl/_stdssl/__init__.py:624:
count = ffi.new("size_t[1]", [0])
TypeError: initializer for ctype 'char' must be a string of length 1, not int
The affected run finished with 23 failed, 1,287 passed, 90 skipped, and 12 deselected. The failures cover both TLS 1.2 and TLS 1.3 resumption tests. The six CPython macOS wheel phases in the same job passed.
Evidence
Failed runs:
- PR protocol: load NumPy handler lazily #1070: https://github.com/scylladb/python-driver/actions/runs/36880456033/job/110431661511
- Unrelated PR cluster: ignore stale DOWN work for removed hosts #1035 with the same 23-test signature: https://github.com/scylladb/python-driver/actions/runs/36890580242/job/110468892682
Passing runs with the same PyPy, tool, dependency, and runner-image versions:
- https://github.com/scylladb/python-driver/actions/runs/36883696278/job/110450633515
- https://github.com/scylladb/python-driver/actions/runs/36890031164/job/110465087110
The failing driver call is exercised here:
python-driver/tests/unit/test_tls_resumption.py
Lines 129 to 131 in db542cd
| def exchange(self): | |
| self._socket.sendall(b'ping') | |
| assert self._socket.recv(4) == b'ping' |
Expected behavior
The macOS Intel PyPy wheel lane should run the TLS-resumption suite reliably, or apply a narrowly scoped runtime-specific workaround for a confirmed upstream defect.
Acceptance criteria
- The source of the intermittent CFFI type mismatch is identified.
- An upstream PyPy issue is linked if the defect is outside the driver.
- The
pp311-macosx_x86_64wheel job no longer fails intermittently on the TLS-resumption suite. - TLS-resumption coverage remains enabled on unaffected runtimes and platforms.
Related
- protocol: load NumPy handler lazily #1070 exposed this occurrence but its lazy-NumPy tests passed in the failing PyPy phase.
- PyPy issue #4888 is superficially similar but has a different failure point: Nightly pypy3.10 fails:
lib.SSL_get_error(ssl, retcode): TypeError: int() not supported on cdata 'size_t[1]' pypy/pypy#4888
Activity