Skip to content

Commit d7f3708

Browse files
committed
cleanup
1 parent ff4ce93 commit d7f3708

File tree

2 files changed

+9
-2
lines changed

2 files changed

+9
-2
lines changed

packages/pytest-simcore/src/pytest_simcore/helpers/autoscaling.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,9 @@ def assert_cluster_state(
2727
== expected_num_machines
2828
)
2929
print("current cluster state:", spied_cluster_analysis.spy_return)
30-
return spied_cluster_analysis.spy_return
30+
cluster = spied_cluster_analysis.spy_return
31+
spied_cluster_analysis.reset_mock()
32+
return cluster
3133

3234

3335
def create_fake_association(

services/autoscaling/tests/unit/test_modules_auto_scaling_computational.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1436,7 +1436,7 @@ async def test_cluster_adapts_machines_on_the_fly(
14361436
)
14371437
analyzed_cluster = assert_cluster_state(
14381438
spied_cluster_analysis,
1439-
expected_calls=1,
1439+
expected_calls=3,
14401440
expected_num_machines=app_settings.AUTOSCALING_EC2_INSTANCES.EC2_INSTANCES_MAX_INSTANCES,
14411441
)
14421442
assert analyzed_cluster.active_nodes
@@ -1521,6 +1521,11 @@ async def test_cluster_adapts_machines_on_the_fly(
15211521
await auto_scale_cluster(
15221522
app=initialized_app, auto_scaling_mode=ComputationalAutoscaling()
15231523
)
1524+
analyzed_cluster = assert_cluster_state(
1525+
spied_cluster_analysis,
1526+
expected_calls=1,
1527+
expected_num_machines=app_settings.AUTOSCALING_EC2_INSTANCES.EC2_INSTANCES_MAX_INSTANCES,
1528+
)
15241529
mock_docker_tag_node.assert_called_with(
15251530
mock.ANY,
15261531
analyzed_cluster.drained_nodes[-1].node,

0 commit comments

Comments
 (0)