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:45 +0300
committerDaniil Cherednik <dcherednik@yandex-team.ru>2022-02-10 16:46:45 +0300
commit87f3eb38999df2d3c1cb77f8ffb9c52ec9c516fb (patch)
treef4ab0734eecf35b22f21952d1aa15496f267a6a3 /library/python/testing/yatest_common/yatest/common/process.py
parent198698b9c1e18958addc9682fbfba4576d604757 (diff)
downloadydb-87f3eb38999df2d3c1cb77f8ffb9c52ec9c516fb.tar.gz
Restoring authorship annotation for <nalpp@yandex-team.ru>. Commit 1 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 a8bcc21f51..62afaedb9d 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):