Too large number of requests to Sanic test clients (regular and ASGI) causes RecursionError: maximum recursion depth exceeded.
Both of the following tests raise RecursionError when triggered. app is a fixture providing Sanic app with TestManager initialized according to documentation (https://sanic.dev/en/plugins/sanic-testing/clients.html).
The cause of this is indefinite expansion of Sanic signals routes in Sanic.signal_router as mentioned in #76 (comment)
@pytest.mark.asyncio(loop_scope="session")
async def test_sanic_asgi_recursion(app):
for _ in range(1000):
await app.asgi_client.get("/live")
def test_sanic_test_recursion(app):
for _ in range(1000):
app.test_client.get("/live")
I am using:
- Python 3.13
- Sanic 25.3.0
- Sanic testing 24.6.0
- Sanic routing 23.12.0
Too large number of requests to Sanic test clients (regular and ASGI) causes
RecursionError: maximum recursion depth exceeded.Both of the following tests raise
RecursionErrorwhen triggered.appis a fixture providing Sanic app withTestManagerinitialized according to documentation (https://sanic.dev/en/plugins/sanic-testing/clients.html).The cause of this is indefinite expansion of Sanic signals routes in
Sanic.signal_routeras mentioned in #76 (comment)I am using: