Skip to content

Commit

Permalink
Skip ASGI websocket tests on PyPy
Browse files Browse the repository at this point in the history
When running on PyPy, the ASGI websocket tests sometimes hang. This is
especially annoying on CI/CD. Most likely the issue lies either in the
Starlette's TestClient implementation, or anyio it delegates to process
the request in a background thread. For a time being, it's better to
skip them for good.
  • Loading branch information
ikalnytskyi committed Nov 17, 2024
1 parent 792f03e commit f10cd09
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 0 additions & 4 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,10 +35,6 @@ jobs:
matrix:
os: [ubuntu-latest, macos-latest]
python-version: ["3.9", "3.10", "3.11", "3.12", "3.13", "pypy-3.10"]
exclude:
# The job hangs for some reason during tests execution. :(
- os: macos-latest
python-version: pypy-3.10

runs-on: ${{ matrix.os }}
steps:
Expand Down
4 changes: 4 additions & 0 deletions tests/ext/test_asgiscopes.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
"""Test ASGI scopes."""

import asyncio
import sys

import async_asgi_testclient
import pytest
Expand Down Expand Up @@ -98,6 +99,9 @@ async def endpoint_ws(websocket, func=func):
def client_factory(connection_type):
"""A factory that creates synchronous test client instances."""

if connection_type == "websocket" and sys.implementation.name == "pypy":
pytest.skip("When running on PyPy, the websocket tests sometimes hang.")

def factory(app):
return ClientFacade(app, connection_type)

Expand Down

0 comments on commit f10cd09

Please sign in to comment.