Commit d433eecf authored by Łukasz Nowak's avatar Łukasz Nowak

Kill supervisord always.

parent de598443
...@@ -36,6 +36,15 @@ class BasicMixin: ...@@ -36,6 +36,15 @@ class BasicMixin:
self.buildout) self.buildout)
def tearDown(self): def tearDown(self):
# XXX: Hardcoded pid, as it is not configurable in slapos
svc = os.path.join(self.instance_root, 'var', 'run', 'supervisord.pid')
if os.path.exists(svc):
try:
pid = int(open(svc).read().strip())
except ValueError:
pass
else:
os.kill(pid, signal.SIGTERM)
shutil.rmtree(self._tempdir, True) shutil.rmtree(self._tempdir, True)
class TestBasicSlapgridCP(BasicMixin, unittest.TestCase): class TestBasicSlapgridCP(BasicMixin, unittest.TestCase):
...@@ -76,15 +85,6 @@ class MasterMixin(BasicMixin): ...@@ -76,15 +85,6 @@ class MasterMixin(BasicMixin):
def tearDown(self): def tearDown(self):
self._unpatchHttplib() self._unpatchHttplib()
# XXX: Hardcoded pid, as it is not configurable in slapos
svc = os.path.join(self.instance_root, 'var', 'run', 'supervisord.pid')
if os.path.exists(svc):
try:
pid = int(open(svc).read().strip())
except ValueError:
pass
else:
os.kill(pid, signal.SIGTERM)
BasicMixin.tearDown(self) BasicMixin.tearDown(self)
class TestSlapgridCPWithMaster(MasterMixin, unittest.TestCase): class TestSlapgridCPWithMaster(MasterMixin, unittest.TestCase):
......
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