Open nrbnlulu opened 1 year ago
@DoctorJohn, I'll have a look at this in the next few days :)
This might have been resolved by #2600
I'm still seeing it in the testing logs:
Task was destroyed but it is pending!
task: <Task pending name='Task-615' coro=<BaseGraphQLTransportWSHandler.handle_connection_init_timeout() running at /home/tommy/Desktop/strawberry/strawberry/subscriptions/protocols/graphql_transport_ws/handlers.py:82> wait_for=<Future pending cb=[Task.task_wakeup()]>>
but it only throws once at the end of the entire suite. I'll dig into it!
This still seems to be a problem which means websockets can't be tested. This is the simple test I have where I'm encountering this error.
@pytest.mark.asyncio
@pytest.mark.django_db
async def test_subscription():
from strawberry.channels import GraphQLWSConsumer
from api.schema import schema
gql_ws_consumer = GraphQLWSConsumer.as_asgi(
schema=schema,
subscription_protocols=(GRAPHQL_TRANSPORT_WS_PROTOCOL,),
)
ws_communicator = WebsocketCommunicator(gql_ws_consumer, "/api/graphql")
connected, subprotocol = await ws_communicator.connect()
assert connected
Can this have a higher priority please since it's been so long since the last comment.
Describe the Bug
If a gql_transport_ws connection ended before
connection_init_timeout
asncio will warn: (if there were no event loops after the task was closed)Very annoying for tests.
repro:
System Information
Additional Context
Upvote & Fund