coveragepy icon indicating copy to clipboard operation
coveragepy copied to clipboard

Current approach to restarting data collection?

Open ShaheedHaque opened this issue 10 months ago • 1 comments

Have you asked elsewhere?

The thread in https://stackoverflow.com/a/40518553/6332554 describes a way to "restart" data collection.

Describe your situation

Celery workers do not honour atexit() handlers, see https://github.com/celery/celery/discussions/8923. I'm trying a couple of different approaches to dealing with this, one being to use the Coverage API to dump the collected data as the worker runs. Since the worker runs my tasks, I can "easily" add the code to the end of my task function.

I therefore need incremental collection. I don't see an obvious solution using the current public API, but I do see the auto_load option on the constructor. Can it or the load() method be used to restart collection?

If not, then is the method in the stackoverflow.com exchange still current?

ShaheedHaque avatar Mar 27 '24 08:03 ShaheedHaque