Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Test failure under PyPy #1581

Closed
aaugustin opened this issue Jan 25, 2025 · 6 comments
Closed

Test failure under PyPy #1581

aaugustin opened this issue Jan 25, 2025 · 6 comments
Labels

Comments

@aaugustin
Copy link
Member

e.g. https://github.com/python-websockets/websockets/actions/runs/12963517695/job/36161210692

This is a symptom of a bug in PyPy: pypy/pypy#5079

I'm wondering if it makes sense to run tests under PyPy when it means that I have to deal with such bugs.

======================================================================
ERROR: test_connection (tests.sync.test_client.ClientTests)
Client connects to server and the handshake succeeds.
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/home/runner/work/websockets/websockets/tests/sync/test_client.py", line 33, in test_connection
    with connect(get_uri(server)) as client:
  File "/home/runner/work/websockets/websockets/.tox/py/lib/pypy3.10/site-packages/websockets/sync/connection.py", line 223, in __exit__
    self.close()
  File "/home/runner/work/websockets/websockets/.tox/py/lib/pypy3.10/site-packages/websockets/sync/connection.py", line 586, in close
    with self.send_context():
  File "/opt/hostedtoolcache/PyPy/3.10.14/x64/lib/pypy3.10/contextlib.py", line 142, in __exit__
    next(self.gen)
  File "/home/runner/work/websockets/websockets/.tox/py/lib/pypy3.10/site-packages/websockets/sync/connection.py", line 991, in send_context
    self.recv_events_thread.join(timeout)
  File "/opt/hostedtoolcache/PyPy/3.10.14/x64/lib/pypy3.10/threading.py", line 1100, in join
    self._wait_for_tstate_lock(timeout=max(timeout, 0))
  File "/opt/hostedtoolcache/PyPy/3.10.14/x64/lib/pypy3.10/threading.py", line 1117, in _wait_for_tstate_lock
    lock.release()
RuntimeError: cannot release un-acquired lock

======================================================================
ERROR: test_logger (tests.sync.test_client.ClientTests)
Client accepts a logger argument.
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/home/runner/work/websockets/websockets/tests/sync/test_client.py", line 98, in test_logger
    with connect(get_uri(server), logger=logger) as client:
  File "/home/runner/work/websockets/websockets/.tox/py/lib/pypy3.10/site-packages/websockets/sync/connection.py", line 223, in __exit__
    self.close()
  File "/home/runner/work/websockets/websockets/.tox/py/lib/pypy3.10/site-packages/websockets/sync/connection.py", line 586, in close
    with self.send_context():
  File "/opt/hostedtoolcache/PyPy/3.10.14/x64/lib/pypy3.10/contextlib.py", line 142, in __exit__
    next(self.gen)
  File "/home/runner/work/websockets/websockets/.tox/py/lib/pypy3.10/site-packages/websockets/sync/connection.py", line 991, in send_context
    self.recv_events_thread.join(timeout)
  File "/opt/hostedtoolcache/PyPy/3.10.14/x64/lib/pypy3.10/threading.py", line 1100, in join
    self._wait_for_tstate_lock(timeout=max(timeout, 0))
  File "/opt/hostedtoolcache/PyPy/3.10.14/x64/lib/pypy3.10/threading.py", line 1117, in _wait_for_tstate_lock
    lock.release()
RuntimeError: cannot release un-acquired lock

----------------------------------------------------------------------
@aaugustin
Copy link
Member Author

Fixed in PyPy 3.10.16 — pypy/pypy#5080 — but GitHub used PyPy 3.101.4 for that run.

@aaugustin
Copy link
Member Author

Ah, this isn't how PyPy releases work. Actually 7.3.17 (which provides 3.10.14) is still the latest release.

Based on this blog post, 7.3.18 requires this and that.

I'm just going to stop running CI on PyPy until the release — and keep this issue open to re-add it later.

aaugustin added a commit that referenced this issue Jan 25, 2025
@x42005e1f
Copy link

PyPy v7.3.18 released yesterday. The bug is indeed fixed, both in 3.10 and 3.11. Checked by me today.

@aaugustin
Copy link
Member Author

Thank you very much for letting me know. Tests are back.

@aaugustin
Copy link
Member Author

Maybe it'll take a bit of time for GitHub Actions to pick the latest release — eventually the situation should settle.

@x42005e1f
Copy link

You can specify pypy3.10-v7.3.18 as described in the setup-python documentation.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants