Re: atExit tooling

Darren Ball <[email protected]> Thu, 24 Sep 2015 14:50:41 -0400
Newsgroups gmane.comp.java.grinder.user
Message-ID <CA+YPNhebmH+AMGpDUZoC9dREngMspZg=Ej1q1FV5sM+HEe9tsg@mail.gmail.com>
Looks like there is:
def __del__(self):
        grinder.logger.info("Thread shutting down")


This is thread specific. If I want to run this once, non-thread specific,
can I just register atExit outside of TestRunner?

Thanks.

Darren

On Thu, Sep 24, 2015 at 12:17 PM, Darren Ball <[email protected]> wrote:

> Hi All,
>
> I recently attempted to add a cleanup of my test on exit.
>
> I added the following:
>
> class TestRunner:
>     def __init__(self):
>         log("Worker process initializing, instrumenting")
>         atexit.register(cleanup)  <-----
>
> This is now executed by each thread launched by the agent.  I don't want
> that, as this cleanup is iterating a deque for cleanup.
>
>
> Is there a correct way to tool this so that it only happens once?
>
> Any help is great help!
>
> Thanks.
>
> Darren
>

------------------------------------------------------------------------------

_______________________________________________
grinder-use mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/grinder-use