diff options
author | Олег <150132506+iddqdex@users.noreply.github.com> | 2025-04-24 10:12:29 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2025-04-24 10:12:29 +0300 |
commit | f5e2233a5e44d6c4eb64dfb8ee43698c4e2272c1 (patch) | |
tree | da8134b2a314f60d226b75547dac9dcb3bff7129 | |
parent | 2f8e053c2bf0f385d8d87b8c4bcf6a7d5cbb5b59 (diff) | |
download | ydb-f5e2233a5e44d6c4eb64dfb8ee43698c4e2272c1.tar.gz |
Use trunk coredumps packages in perf (#17645)
-rw-r--r-- | ydb/tests/olap/lib/allure_utils.py | 6 | ||||
-rw-r--r-- | ydb/tests/olap/lib/ydb_cluster.py | 4 | ||||
-rw-r--r-- | ydb/tests/olap/load/lib/conftest.py | 19 |
3 files changed, 16 insertions, 13 deletions
diff --git a/ydb/tests/olap/lib/allure_utils.py b/ydb/tests/olap/lib/allure_utils.py index f58f5df08f7..6fa22d09708 100644 --- a/ydb/tests/olap/lib/allure_utils.py +++ b/ydb/tests/olap/lib/allure_utils.py @@ -52,14 +52,14 @@ def _set_node_errors(test_info: dict[str, str], node_errors: list[NodeErrors]) - return html = '<ul>' for node in node_errors: - html += f'<li>{node.node.ic_port}@{node.node.host}' + html += f'<li>{node.node.slot}' if node.message: html += f'<p>Node {node.message}</p>' if node.was_oom: html += '<p>Node was killed by OOM</p>' for core_id, core_hash in node.core_hashes: - color = hex(0xFF0000 + hash(core_hash) % 0xFFFF).split('x')[-1] - html += f'<p>There was coredump <a target="_blank" href="https://coredumps.yandex-team.ru/v3/cores/{core_id}" style="background-color: #{color}">{core_hash}</a></p>' + color = hex(0xFF0000 + hash(str(core_hash)) % 0xFFFF).split('x')[-1] + html += f'<p>There was coredump <a target="_blank" href="https://coredumps.yandex-team.ru/core_trace?core_id={core_id}" style="background-color: #{color}">{core_hash}</a></p>' html += '</li>' html += '</ul>' test_info['<span style="background-color: #FF8888">node errors</span>'] = html diff --git a/ydb/tests/olap/lib/ydb_cluster.py b/ydb/tests/olap/lib/ydb_cluster.py index 86b71649221..d74881f8035 100644 --- a/ydb/tests/olap/lib/ydb_cluster.py +++ b/ydb/tests/olap/lib/ydb_cluster.py @@ -50,6 +50,10 @@ class YdbCluster: self.role = YdbCluster.Node.Role.UNKNOWN self.tablets = [YdbCluster.Node.Tablet(t) for t in desc.get('Tablets', [])] + @property + def slot(self) -> str: + return f'{"static" if self.role == YdbCluster.Node.Role.STORAGE else self.ic_port}@{self.host}' + _ydb_driver = None _results_driver = None _cluster_info = None diff --git a/ydb/tests/olap/load/lib/conftest.py b/ydb/tests/olap/load/lib/conftest.py index 492c9600b26..ff0c3ef1083 100644 --- a/ydb/tests/olap/load/lib/conftest.py +++ b/ydb/tests/olap/load/lib/conftest.py @@ -37,7 +37,7 @@ class LoadSuiteBase: scale: Optional[int] = None query_prefix: str = get_external_param('query-prefix', '') verify_data: bool = True - __nodes_state: Optional[dict[tuple[str, int], YdbCluster.Node]] = None + __nodes_state: Optional[dict[str, YdbCluster.Node]] = None @classmethod def suite(cls) -> str: @@ -152,7 +152,7 @@ class LoadSuiteBase: @classmethod def save_nodes_state(cls) -> None: - cls.__nodes_state = {(n.host, n.ic_port): n for n in YdbCluster.get_cluster_nodes(db_only=True)} + cls.__nodes_state = {n.slot: n for n in YdbCluster.get_cluster_nodes(db_only=True)} @classmethod def __get_core_hashes_by_pod(cls, hosts: set[str], start_time: float, end_time: float) -> dict[str, list[tuple[str, str]]]: @@ -172,9 +172,9 @@ class LoadSuiteBase: exec.wait(check_exit_code=False) if exec.returncode == 0: for core in json.loads(f'[{exec.stdout.decode("utf-8").strip(",")}]'): - pod_name = core.get('pod', '') - core_hashes.setdefault(pod_name, []) - core_hashes[pod_name].append((core.get('core_uuid', ''), core.get('core_hash', ''))) + slot = f"{core.get('slot', '')}@{h}" + core_hashes.setdefault(slot, []) + core_hashes[slot].append((core.get('core_id', ''), core.get('core_hash', ''))) else: logging.error(f'Error while search coredumps on host {h}: {exec.stderr.decode("utf-8")}') return core_hashes @@ -203,13 +203,12 @@ class LoadSuiteBase: node_errors = [] fail_hosts = set() for node in YdbCluster.get_cluster_nodes(db_only=True): - node_id = (node.host, node.ic_port) - saved_node = cls.__nodes_state.get(node_id) + saved_node = cls.__nodes_state.get(node.slot) if saved_node is not None: if node.start_time > saved_node.start_time: node_errors.append(NodeErrors(node, 'was restarted')) fail_hosts.add(node.host) - del cls.__nodes_state[node_id] + del cls.__nodes_state[node.slot] for _, node in cls.__nodes_state.items(): node_errors.append(NodeErrors(node, 'is down')) fail_hosts.add(node.host) @@ -220,11 +219,11 @@ class LoadSuiteBase: core_hashes = cls.__get_core_hashes_by_pod(fail_hosts, result.start_time, end_time) ooms = cls.__get_hosts_with_omms(fail_hosts, result.start_time, end_time) for node in node_errors: - node.core_hashes = core_hashes.get(f'{node.node.ic_port}@{node.node.host}', []) + node.core_hashes = core_hashes.get(f'{node.node.slot}', []) node.was_oom = node.node.host in ooms for err in node_errors: - result.add_error(f'Node {err.node.ic_port}@{err.node.host} {err.message}') + result.add_error(f'Node {err.node.slot} {err.message}') return node_errors @classmethod |