aboutsummaryrefslogtreecommitdiffstats
path: root/library/python/testing/yatest_common/yatest/common/process.py
diff options
context:
space:
mode:
authornalpp <nalpp@yandex-team.ru>2022-02-10 16:46:46 +0300
committerDaniil Cherednik <dcherednik@yandex-team.ru>2022-02-10 16:46:46 +0300
commit30d1ef3941e0dc835be7609de5ebee66958f215a (patch)
tree49e222ea1c5804306084bb3ae065bb702625360f /library/python/testing/yatest_common/yatest/common/process.py
parent87f3eb38999df2d3c1cb77f8ffb9c52ec9c516fb (diff)
downloadydb-30d1ef3941e0dc835be7609de5ebee66958f215a.tar.gz
Restoring authorship annotation for <nalpp@yandex-team.ru>. Commit 2 of 2.
Diffstat (limited to 'library/python/testing/yatest_common/yatest/common/process.py')
-rw-r--r--library/python/testing/yatest_common/yatest/common/process.py20
1 files changed, 10 insertions, 10 deletions
diff --git a/library/python/testing/yatest_common/yatest/common/process.py b/library/python/testing/yatest_common/yatest/common/process.py
index 62afaedb9d..a8bcc21f51 100644
--- a/library/python/testing/yatest_common/yatest/common/process.py
+++ b/library/python/testing/yatest_common/yatest/common/process.py
@@ -24,22 +24,22 @@ from . import path
from . import environment
-MAX_OUT_LEN = 1000 * 1000 # 1 mb
+MAX_OUT_LEN = 1000 * 1000 # 1 mb
MAX_MESSAGE_LEN = 1500
SANITIZER_ERROR_PATTERN = br": ([A-Z][\w]+Sanitizer)"
GLIBC_PATTERN = re.compile(r"\S+@GLIBC_([0-9.]+)")
yatest_logger = logging.getLogger("ya.test")
-def truncate(s, size):
- if s is None:
- return None
- elif len(s) <= size:
- return s
- else:
+def truncate(s, size):
+ if s is None:
+ return None
+ elif len(s) <= size:
+ return s
+ else:
return (b'...' if isinstance(s, bytes) else '...') + s[-(size - 3):]
-
-
+
+
def get_command_name(command):
return os.path.basename(command.split()[0] if isinstance(command, six.string_types) else command[0])
@@ -623,7 +623,7 @@ def wait_for(check_function, timeout, fail_message="", sleep_time=1.0, on_check_
message = "{} second(s) wait timeout has expired".format(timeout)
if fail_message:
message += ": {}".format(fail_message)
- raise TimeoutError(truncate(message, MAX_MESSAGE_LEN))
+ raise TimeoutError(truncate(message, MAX_MESSAGE_LEN))
def _kill_process_tree(process_pid, target_pid_signal=None):