Open
Description
Describe the bug
Performance drop with using coverage testing starlette websocket.
To Reproduce
How can we reproduce the problem? Please be specific. Don't link to a failing CI job. Answer the questions below:
platform linux -- Python 3.10.5, pytest-7.1.2, pluggy-1.0.0
- Package versions
>>> coverage.__version__
'6.4.1'
>>> fastapi.__version__
'0.78.0'
>>> starlette.__version__
'0.19.1'
- code: https://pastebin.com/F2iXUM4E.
- just running this code with
pytest
will in average less than 1s. But withpytest --cov
orcoverage run -m pytest
increases its execution time 10 times (10s+ avg)
Expected behavior
Coverage do not affect execution time.
Additional context
As far as I can see problem with async to sync in starlette.testclient.TestClient
and coverage
.
Also coverage do not affect execution time with concurrency=greenlet
(because it wont check any code that way) but execution time raises even more with concurrency=thread.greenlet