From f0db4283899b8cf5e72182e2eb5e548789c365b9 Mon Sep 17 00:00:00 2001 From: Jesse Schmidt Date: Mon, 30 Oct 2023 15:06:25 -0700 Subject: [PATCH] fix tests --- lib/live_cluster/client/cluster.py | 2 +- lib/live_cluster/collectinfo_controller.py | 9 +++++---- test/e2e/util.py | 5 ++--- 3 files changed, 8 insertions(+), 8 deletions(-) diff --git a/lib/live_cluster/client/cluster.py b/lib/live_cluster/client/cluster.py index c9fd7f92..4c6c1174 100644 --- a/lib/live_cluster/client/cluster.py +++ b/lib/live_cluster/client/cluster.py @@ -469,7 +469,7 @@ def get_nodes( constants.NodeSelection.PRINCIPAL, constants.NodeSelection.RANDOM, ] - | list[str], + | list[str] = constants.NodeSelection.ALL, ) -> list[Node]: use_nodes = [] diff --git a/lib/live_cluster/collectinfo_controller.py b/lib/live_cluster/collectinfo_controller.py index c0ba3d9a..e3e00344 100644 --- a/lib/live_cluster/collectinfo_controller.py +++ b/lib/live_cluster/collectinfo_controller.py @@ -21,6 +21,7 @@ import sys import traceback from typing import Any, Callable, Optional +from lib.live_cluster.client.node import Node from lib.live_cluster.generate_config_controller import GenerateConfigController from lib.utils.types import NodeDict @@ -822,15 +823,15 @@ async def _dump_collectinfo_dynamic_aerospike_conf(self, as_logfile_prefix): cluster. This will include changes that have not yet been save to the static aerospike.conf file. """ - ip_id_map = self.cluster.get_node_ids() + nodes: list[Node] = self.cluster.get_nodes() - async def _get_aerospike_conf(self, ip, id): + async def _get_aerospike_conf(self, key, id): complete_filename = as_logfile_prefix + id + "_aerospike.conf" - line = f"-o {complete_filename} with {ip}" + line = f"-o {complete_filename} with {key}" await GenerateConfigController().execute(line.split()) results = await asyncio.gather( - *[_get_aerospike_conf(self, ip, id) for ip, id in ip_id_map.items()], + *[_get_aerospike_conf(self, node.key, node.node_id) for node in nodes], return_exceptions=True, ) diff --git a/test/e2e/util.py b/test/e2e/util.py index 7e5cf773..b49f3d22 100644 --- a/test/e2e/util.py +++ b/test/e2e/util.py @@ -138,13 +138,12 @@ async def capture_separate_and_parse_output(rc, commands): def get_collectinfo_path(cp: CompletedProcess, collectinfo_prefix: str): - collectinfo_path = None for line in reversed(cp.stderr.splitlines()): if collectinfo_prefix in line and line.startswith("INFO:"): words = line.split() for word in words: - if collectinfo_prefix in word: - print("Found collectinfo_prefix", collectinfo_path) + if collectinfo_prefix in word and ".tgz" in word: + print("Found collectinfo_prefix", word) return word raise Exception("Unable to find collectinfo path in output")