From 12846d7e930aa54bbf19ca11005bef44dc1dcc6e Mon Sep 17 00:00:00 2001 From: Gennadiy Chuyeshov Date: Thu, 26 Oct 2023 15:17:00 -0700 Subject: [PATCH] Fix for pre-commit --- .../models/org/netflix/elasticsearch.py | 2 +- tests/netflix/test_elasticsearch.py | 20 ++++++++++++++----- 2 files changed, 16 insertions(+), 6 deletions(-) diff --git a/service_capacity_modeling/models/org/netflix/elasticsearch.py b/service_capacity_modeling/models/org/netflix/elasticsearch.py index 754f5cd..1927962 100644 --- a/service_capacity_modeling/models/org/netflix/elasticsearch.py +++ b/service_capacity_modeling/models/org/netflix/elasticsearch.py @@ -503,7 +503,7 @@ def default_desires(user_desires, extra_model_arguments: Dict[str, Any]): confidence=0.98, ), ), - # Most latency sensitive Elasticsearch clusters are in the < 100GiB range + # Most latency sensitive Elasticsearch clusters are in the <100GiB range data_shape=DataShape( estimated_state_size_gib=Interval( low=10, mid=100, high=1000, confidence=0.98 diff --git a/tests/netflix/test_elasticsearch.py b/tests/netflix/test_elasticsearch.py index 5e9e012..f075d92 100644 --- a/tests/netflix/test_elasticsearch.py +++ b/tests/netflix/test_elasticsearch.py @@ -129,14 +129,24 @@ def test_es_simple_certain(): assert plan, "One or more plans is empty" assert plan.candidate_clusters, "candidate_clusters is empty" assert plan.candidate_clusters.zonal, "candidate_clusters.zonal is empty" - assert len(plan.candidate_clusters.zonal) == 9, "len(candidate_clusters.zonal) != 9" + assert ( + len(plan.candidate_clusters.zonal) == 9 + ), "len(candidate_clusters.zonal) != 9" - cluster_type_counts = Counter(zone.cluster_type for zone in plan.candidate_clusters.zonal) + cluster_type_counts = Counter( + zone.cluster_type for zone in plan.candidate_clusters.zonal + ) assert len(cluster_type_counts) == 3, "Expecting 3 cluster types" - assert cluster_type_counts["elasticsearch-search"] == 3, "Expecting exactly 3 search nodes" - assert cluster_type_counts["elasticsearch-master"] == 3, "Expecting exactly 3 master nodes" - assert cluster_type_counts["elasticsearch-data"] >= 3, "Expecting at least 3 data nodes" + assert ( + cluster_type_counts["elasticsearch-search"] == 3 + ), "Expecting exactly 3 search nodes" + assert ( + cluster_type_counts["elasticsearch-master"] == 3 + ), "Expecting exactly 3 master nodes" + assert ( + cluster_type_counts["elasticsearch-data"] >= 3 + ), "Expecting at least 3 data nodes" def zonal_summary(zlr):