nuxeo / FunkLoad

Functional and load testing framework for web applications, written in Python
http://funkload.nuxeo.org/
GNU General Public License v2.0
382 stars 83 forks source link

Distributed bench run hangs at the end of the run #60

Open ndokos opened 12 years ago

ndokos commented 12 years ago

In addition to the main thread, there were threads (one per node) that were hanging around, preventing the return of main() in BenchRunner.py from completing. I added a line to kill all the workers and that did the trick:

...
if options.distribute:
    from Distributed import DistributionMgr
    ret = None
    try:
        distmgr = DistributionMgr(
            args[0], klass, method, options, cmd_args)
    except UserWarning, error:
        trace(red_str("Distribution failed with:%s \n" % (error)))

    try:
        distmgr.prepare_workers(allow_errors=True)
        ret = distmgr.run()
        distmgr.final_collect()
    except KeyboardInterrupt:
        trace("* ^C received *")
        distmgr.abort()

     # added this line
     [w.die() for w in distmgr._workers]
     return ret
else:
     ...
tarekziade commented 12 years ago

I think you can simply call distmgr.abort() in any case in a finally statement.

See https://github.com/mozilla-services/FunkLoad/commit/db2af3c1de2bd14b5a15dc799383f5c35ae3d434