app_manager: Clean up apps harder

Necessary for neutron functional tests so that a test won't
interfere the next test in a run.

Signed-off-by: YAMAMOTO Takashi <yamamoto@valinux.co.jp>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
This commit is contained in:
YAMAMOTO Takashi 2015-04-10 17:36:57 +09:00 committed by FUJITA Tomonori
parent cfdba5c12d
commit 78cb838b2e

View File

@ -28,6 +28,7 @@ import itertools
import logging
import sys
import os
import gc
from ryu import cfg
from ryu import utils
@ -344,6 +345,10 @@ class AppManager(object):
hub.joinall(services)
finally:
app_mgr.close()
for t in services:
t.kill()
hub.joinall(services)
gc.collect()
@staticmethod
def get_instance():
@ -511,5 +516,7 @@ class AppManager(object):
self._close(app)
close_dict.clear()
close_all(self.applications)
for app_name in list(self.applications.keys()):
self.uninstantiate(app_name)
assert not self.applications
close_all(self.contexts)