Merge "kill orphans during probe test setup"

This commit is contained in:
Zuul
2018年02月15日 07:22:02 +00:00
committed by Gerrit Code Review

View File

@@ -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)
Reference in New Issue
openstack/swift
Block a user
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.

The note is not visible to the blocked user.