[#359] Run metrics tests before other tests
Some checks failed
DCO check / DCO (pull_request) Failing after 25s
Some checks failed
DCO check / DCO (pull_request) Failing after 25s
This commit is contained in:
parent
44bb446847
commit
411f746591
2 changed files with 11 additions and 15 deletions
|
@ -56,20 +56,6 @@ start_time = pytest.StashKey[int]()
|
|||
test_outcome = pytest.StashKey[str]()
|
||||
|
||||
|
||||
# pytest hook. Do not rename
|
||||
def pytest_collection_modifyitems(items: list[pytest.Item]):
|
||||
# Change order of tests based on @pytest.mark.order(<int>) marker
|
||||
def order(item: pytest.Item) -> int:
|
||||
order_marker = item.get_closest_marker("order")
|
||||
if order_marker and (len(order_marker.args) != 1 or not isinstance(order_marker.args[0], int)):
|
||||
raise RuntimeError("Incorrect usage of pytest.mark.order")
|
||||
|
||||
order_value = order_marker.args[0] if order_marker else 0
|
||||
return order_value
|
||||
|
||||
items.sort(key=lambda item: order(item))
|
||||
|
||||
|
||||
# pytest hook. Do not rename
|
||||
def pytest_collection_finish(session: pytest.Session):
|
||||
items_total = len(session.items)
|
||||
|
|
|
@ -220,7 +220,17 @@ class TestContainerMetrics(ClusterTestBase):
|
|||
self.tick_epoch()
|
||||
wait_for_container_deletion(default_wallet, container, shell=self.shell, endpoint=cluster.default_rpc_endpoint)
|
||||
|
||||
with reporter.step(f"Check metrics value in each nodes, should not be show any result"):
|
||||
with reporter.step(f"Check metric {metric_name} in each nodes, should not be show any result"):
|
||||
futures = parallel(self.get_metrics_search_by_greps_parallel, cluster.cluster_nodes, command=metric_name, cid=container)
|
||||
metrics_results = [future.result() for future in futures if future.result() is not None]
|
||||
assert len(metrics_results) == 0, f"Metrics value is not empty in Prometheus, actual value in nodes: {metrics_results}"
|
||||
|
||||
with reporter.step("Check metric 'frostfs_node_engine_container_size_bytes' in each nodes, should not be show any result"):
|
||||
futures = parallel(
|
||||
self.get_metrics_search_by_greps_parallel,
|
||||
cluster.cluster_nodes,
|
||||
command="frostfs_node_engine_container_size_bytes",
|
||||
cid=container,
|
||||
)
|
||||
metrics_results = [future.result() for future in futures if future.result() is not None]
|
||||
assert len(metrics_results) == 0, f"Metrics value is not empty, actual value in nodes: {metrics_results}"
|
||||
|
|
Loading…
Reference in a new issue