diff options
Diffstat (limited to 'src/borg/testsuite/archiver.py')
-rw-r--r-- | src/borg/testsuite/archiver.py | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/src/borg/testsuite/archiver.py b/src/borg/testsuite/archiver.py index dd3285fd3..dfe6e75c5 100644 --- a/src/borg/testsuite/archiver.py +++ b/src/borg/testsuite/archiver.py @@ -3,6 +3,7 @@ import errno import json import logging import os +import pstats import random import shutil import socket @@ -1688,6 +1689,20 @@ class ArchiverTestCase(ArchiverTestCaseBase): assert log_message['levelname'] == 'DEBUG' # there should only be DEBUG messages assert isinstance(log_message['message'], str) + def test_debug_profile(self): + self.create_test_files() + self.cmd('init', '--encryption=repokey', self.repository_location) + self.cmd('create', self.repository_location + '::test', 'input', '--debug-profile=create.prof') + self.cmd('debug', 'convert-profile', 'create.prof', 'create.pyprof') + stats = pstats.Stats('create.pyprof') + stats.strip_dirs() + stats.sort_stats('cumtime') + + self.cmd('create', self.repository_location + '::test2', 'input', '--debug-profile=create.pyprof') + stats = pstats.Stats('create.pyprof') # Only do this on trusted data! + stats.strip_dirs() + stats.sort_stats('cumtime') + def test_common_options(self): self.create_test_files() self.cmd('init', '--encryption=repokey', self.repository_location) |