From: Zack Cerza Date: Wed, 2 Jul 2014 16:08:48 +0000 (-0600) Subject: Add a unit test simulating simultaneous checkouts X-Git-Tag: v0.94.10~27^2^2~364^2~66 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=cb7fdfb73f4d20a895407b2a796035ad59894fdb;p=ceph.git Add a unit test simulating simultaneous checkouts Signed-off-by: Zack Cerza --- diff --git a/teuthology/test/test_repo_utils.py b/teuthology/test/test_repo_utils.py index 9e94c1af0f60..0cb7b06022af 100644 --- a/teuthology/test/test_repo_utils.py +++ b/teuthology/test/test_repo_utils.py @@ -5,6 +5,7 @@ import shutil import subprocess from .. import repo_utils +from .. import parallel repo_utils.log.setLevel(logging.WARNING) @@ -108,3 +109,13 @@ class TestRepoUtils(object): def test_enforce_invalid_branch(self): with raises(ValueError): repo_utils.enforce_repo_state(self.repo_url, self.dest_path, 'a b') + + def test_simultaneous_access(self): + count = 5 + with parallel.parallel() as p: + for i in range(count): + print "starting %s" % i + p.spawn(repo_utils.enforce_repo_state, self.repo_url, + self.dest_path, 'master') + for result in p: + print "result %s %s" % (i, result)