diff options
author | sharpeye <sharpeye@yandex-team.ru> | 2022-03-23 22:30:44 +0300 |
---|---|---|
committer | Daniil Cherednik <dcherednik@yandex-team.ru> | 2022-03-23 22:30:44 +0300 |
commit | 5962f8c1bf4d647772598f9fc53fa99d2f8450f3 (patch) | |
tree | 7e2ff707c769775ca9444e01f47ee78276a23bc6 /library/python/cores/__init__.py | |
parent | 3625b426489dd9c0fba29cf8f6d50cc972984fa9 (diff) | |
download | ydb-5962f8c1bf4d647772598f9fc53fa99d2f8450f3.tar.gz |
merge to stable-22-2
[loadtest] NBS-3062: custom core pattern
REVIEW: 2367932
[yatest] NBS-3062: write backtrace to html with text mode
Если бинарь собирается под python3, то при попытке сдампить корку в html-файл, получаем ошибку:
```
Traceback (most recent call last):
File "library/python/testing/yatest_common/yatest/common/process.py", line 395, in verify_no_coredumps
self._recover_core()
File "library/python/testing/yatest_common/yatest/common/process.py", line 292, in _recover_core
backtrace_to_html(bt_filename, pbt_filename)
File "library/python/testing/yatest_common/yatest/common/process.py", line 737, in backtrace_to_html
coredump_filter.filter_stackdump(bt_filename, stream=afile)
File "sandbox/sdk2/helpers/coredump_filter/__init__.py", line 1294, in filter_stackdump
return dumper.dump()
File "sandbox/sdk2/helpers/coredump_filter/__init__.py", line 1130, in dump
html_prolog(self.stream, self.timestamp)
File "sandbox/sdk2/helpers/coredump_filter/__init__.py", line 927, in html_prolog
stream.write(prolog.format(
TypeError: a bytes-like object is required, not 'str'
```
REVIEW: 2370907
[harness] NBS-3062: forward custom core pattern to yatest.process
REVIEW: 2367454
DEVTOOLSSUPPORT-15739, NBS-3062: custom core pattern
REVIEW: 2367120
REVIEW: 2396836
x-ydb-stable-ref: c381d0acc3d8c7a34a2f1f7a34e7f7b1b177c047
Diffstat (limited to 'library/python/cores/__init__.py')
-rw-r--r-- | library/python/cores/__init__.py | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/library/python/cores/__init__.py b/library/python/cores/__init__.py index fdb1f82a46..e3eea6ab5d 100644 --- a/library/python/cores/__init__.py +++ b/library/python/cores/__init__.py @@ -21,8 +21,7 @@ def _read_file(filename): return afile.read().strip("\n") -def recover_core_dump_file(binary_path, cwd, pid): - +def recover_core_dump_file(binary_path, cwd, pid, core_pattern=None): class CoreFilePattern(object): def __init__(self, path, mask): self.path = path @@ -36,7 +35,8 @@ def recover_core_dump_file(binary_path, cwd, pid): logger.debug("hostname = '%s'", socket.gethostname()) logger.debug("rlimit_core = '%s'", str(resource.getrlimit(resource.RLIMIT_CORE))) - core_pattern = _read_file("/proc/sys/kernel/core_pattern") + if core_pattern is None: + core_pattern = _read_file("/proc/sys/kernel/core_pattern") logger.debug("core_pattern = '%s'", core_pattern) if core_pattern.startswith("/"): default_pattern = CoreFilePattern(os.path.dirname(core_pattern), '*') |