-
-
Notifications
You must be signed in to change notification settings - Fork 439
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
asyncio.ProcessPoolExecutor tracing not working correctly #481
Comments
Can you provide a reproducible description of the problem before we jump into the solution? |
Original comment by Alexander Mohr (Bitbucket: thehesiod, GitHub: thehesiod) ok I have a reproducible testcase! cov_tester.py:
cov_helper.py
.coveragerc
test run:
now look at the results, note how nothing in get_executor_props is marked as run, further note that in executor_task, loop.run_until_complete is not marked as run, and yet the function that it runs is marked as run :) also "async def doit()" is not marked as run (would expect everything after init_coverage would be). it seems like its only marking lines as hit in the async task, but not outside it. Perhaps there's some other initialization thats missing? |
Thanks, I'm looking into this. BTW, I took your suggestion of returning the Coverage instance from process_startup. That's in f3b4faef8280 (bb). |
Originally reported by Alexander Mohr (Bitbucket: thehesiod, GitHub: thehesiod)
first I had to monkey patch concurrent.futures.process._process_worker from concurrent.futures.ProcessPoolExecutor because it doesn't call the atexit handlers:
my first note is that this monkey patch would be a lot simpler if coverage.process_startup() returned the Coverage instance.
With the above patching, and running with "-p" for parallel, I actually get coverage data, however it's all bizarre. For example: in a function it will say the first line executed, but the next line did not, and the loop.run_until_complete line did not execute, but most of the lines in the coroutine did.
The text was updated successfully, but these errors were encountered: