Commit 0cc4eb38 authored by Vincent Pelletier's avatar Vincent Pelletier

Always call release before thread exits.

parent 02bef475
...@@ -120,15 +120,17 @@ class TestSuite(object): ...@@ -120,15 +120,17 @@ class TestSuite(object):
assert test not in self.running assert test not in self.running
self.running[test] = instance = self._pool.pop(0) self.running[test] = instance = self._pool.pop(0)
def run(): def run():
self._instance.id = instance try:
if instance not in self._ready: self._instance.id = instance
self._ready.add(instance) if instance not in self._ready:
self.setup() self._ready.add(instance)
status_dict = self.run(test) self.setup()
if on_stop is not None: status_dict = self.run(test)
on_stop(status_dict) if on_stop is not None:
self._pool.append(self.running.pop(test)) on_stop(status_dict)
self.release() self._pool.append(self.running.pop(test))
finally:
self.release()
thread = threading.Thread(target=run) thread = threading.Thread(target=run)
thread.setDaemon(True) thread.setDaemon(True)
thread.start() thread.start()
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment