Re: atExit tooling
Philip Aston <[email protected]> Thu, 24 Sep 2015 20:25:48 +0100
| Newsgroups | gmane.comp.java.grinder.user |
|---|---|
| Message-ID | <[email protected]> |
Yes, that should be fine. On 24/09/15 19:50, Darren Ball wrote: > Looks like there is: > |def| |__del__(||self||):| > | ||grinder.logger.info <http://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] > <mailto:[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 ------------------------------------------------------------------------------