kill orphans during probe test setup
orphans processes sometimes cause probe test failures so get rid of them before each test. Change-Id: I4ba6748d30fbb28371f13aa95387c49bc8223402
This commit is contained in:
parent
6b9098eead
commit
1f4ebbc990
@ -266,18 +266,26 @@ def get_policy(**kwargs):
|
||||
raise unittest.SkipTest('No policy matching %s' % kwargs)
|
||||
|
||||
|
||||
def resetswift():
|
||||
p = Popen("resetswift 2>&1", shell=True, stdout=PIPE)
|
||||
def run_cleanup(cmd):
|
||||
p = Popen(cmd + " 2>&1", shell=True, stdout=PIPE)
|
||||
stdout, _stderr = p.communicate()
|
||||
if p.returncode:
|
||||
raise AssertionError(
|
||||
'Cleanup with "resetswift" failed: stdout: %s, stderr: %s'
|
||||
% (stdout, _stderr))
|
||||
'Cleanup with %r failed: stdout: %s, stderr: %s'
|
||||
% (cmd, stdout, _stderr))
|
||||
|
||||
print(stdout)
|
||||
Manager(['all']).stop()
|
||||
|
||||
|
||||
def resetswift():
|
||||
run_cleanup("resetswift")
|
||||
|
||||
|
||||
def kill_orphans():
|
||||
run_cleanup("swift-orphans -a 0 -k 9")
|
||||
|
||||
|
||||
class Body(object):
|
||||
|
||||
def __init__(self, total=3.5 * 2 ** 20):
|
||||
@ -328,6 +336,7 @@ class ProbeTest(unittest.TestCase):
|
||||
|
||||
def setUp(self):
|
||||
resetswift()
|
||||
kill_orphans()
|
||||
try:
|
||||
self.ipport2server = {}
|
||||
self.configs = defaultdict(dict)
|
||||
|
Loading…
Reference in New Issue
Block a user