File tree Expand file tree Collapse file tree 2 files changed +9
-2
lines changed
packages/pytest-simcore/src/pytest_simcore/helpers
services/autoscaling/tests/unit Expand file tree Collapse file tree 2 files changed +9
-2
lines changed Original file line number Diff line number Diff 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
3335def create_fake_association (
Original file line number Diff line number Diff 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 ,
You can’t perform that action at this time.
0 commit comments