diff --git a/benchmarks/basic_commands.py b/benchmarks/basic_commands.py index 0d04981581e8b44e91a714266ea395851320b999_YmVuY2htYXJrcy9iYXNpY19jb21tYW5kcy5weQ==..dd1acf7816df8e6fbc740837cbae96b891096798_YmVuY2htYXJrcy9iYXNpY19jb21tYW5kcy5weQ== 100644 --- a/benchmarks/basic_commands.py +++ b/benchmarks/basic_commands.py @@ -284,6 +284,23 @@ def setup(self, repo_name, strip): super(UnbundleTimeSuite, self).setup(repo_name, "local", strip, None) + tmpdir = os.path.join(REPOS_DIR, '.tmp') + try: + os.makedirs(tmpdir) + except OSError as exc: + if exc.errno != errno.EEXIST: + raise + + self.tmp_clone_path = os.path.join(tmpdir, 'clone-{}'.format( + os.path.basename(self.clone_path))) + # XXX: This should be deleted at the end but teardown, like setup, is + # called for each repeat... + self.check_output('rsync', '-aH', '--delete', '{}/'.format(self.clone_path), + self.tmp_clone_path) + # Wait for everything to be written on disk to avoid Disk IO wait to + # impact performances metrics + self.check_output('sync') + self.hg("bundle", "--base", "not(%s)" % strip, "/tmp/bundle.bundle") def time_debugunbundle(self, *args, **kwargs): @@ -287,7 +304,7 @@ self.hg("bundle", "--base", "not(%s)" % strip, "/tmp/bundle.bundle") def time_debugunbundle(self, *args, **kwargs): - self.run(self.clone_path, 'unbundle', "/tmp/bundle.bundle", + self.run(self.tmp_clone_path, 'unbundle', "/tmp/bundle.bundle", expected_return_code=0)