-
-
Notifications
You must be signed in to change notification settings - Fork 433
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
Coverage=5.3, Python=2.7, when i send new request to my server and collect the coverage, it does not include my new requests #1853
Comments
You have logging in your coverage management code. Can you show the output you are seeing? Also, are there new subprocesses spawned to handle requests? |
After some debugs, I have updated my bootstrap file above, please check before see this. I am not sure if I have missed some processes or something went wrong in Coverage.py settings, but I will still attach my logs here. So for the step 4, 6, the logs are as below: step 4: I started the application, make no request and collect the coverage by sending SIGUSR2 to all processes containing "Python" in its name:
And for step 6, I sent a request and collect again, the logs are:
Everything seems to be right but I still cannot collect the coverage, the result is still 0% |
It seems that if I use the Flask's method app.run() with multiprocesses, I will not collect any coverage data. |
I will appreciate it if you can maybe give us some hint about this problem, and i am not sure if there is some configuration error or it is just because there might be some bug in the version 5.3 |
You should read this: https://coverage.readthedocs.io/en/latest/subprocess.html coverage 5.3 is unsupported and Python 2.7 is unsupported, but that might fix your problem. |
The background of this issue is that I need to collect the coverage data of running Python project without interrupting the process. However I found that it always only shows the original coverage data for some constants, so I wrote a demo for this and found the same problem.
For some reason we have to use the shell file to create a new bootstrap.py file and start the application:
the code above is my bootstrap.py, where I started my Python project, and it also has one useful subfile(views.py) as below:
The coveragerc file is also attached here:
The version for Coverage.py and my Python version is 5.3 and 2.7 separately, and here is what i do:
coverage combine && coverage report && mv .coverage .coverage.before
(otherwise the original coverage data file will be covered by coverage combine but that's not that important)
Please inform me if you have any idea of this problem, as our project is using Python 2.7 and cannot be updated to Python 3 temporarily, Thank you for your help
The text was updated successfully, but these errors were encountered: