@@ -204,8 +204,7 @@ def minimal_configuration(
204204 disable_dynamic_service_background_task : None ,
205205 disable_buffers_pool_background_task : None ,
206206 mocked_redis_server : None ,
207- ) -> None :
208- ...
207+ ) -> None : ...
209208
210209
211210def _assert_rabbit_autoscaling_message_sent (
@@ -626,11 +625,11 @@ async def _assert_wait_for_ec2_instances_running() -> list[InstanceTypeDef]:
626625 )
627626 # update our fake node
628627 fake_attached_node .spec .labels [_OSPARC_SERVICE_READY_LABEL_KEY ] = "true"
629- fake_attached_node .spec .labels [
630- _OSPARC_SERVICES_READY_DATETIME_LABEL_KEY
631- ] = mock_docker_tag_node . call_args_list [ 2 ][ 1 ][ "tags" ][
632- _OSPARC_SERVICES_READY_DATETIME_LABEL_KEY
633- ]
628+ fake_attached_node .spec .labels [_OSPARC_SERVICES_READY_DATETIME_LABEL_KEY ] = (
629+ mock_docker_tag_node . call_args_list [ 2 ][ 1 ][ "tags" ][
630+ _OSPARC_SERVICES_READY_DATETIME_LABEL_KEY
631+ ]
632+ )
634633 # check the activate time is later than attach time
635634 assert arrow .get (
636635 mock_docker_tag_node .call_args_list [1 ][1 ]["tags" ][
@@ -661,11 +660,11 @@ async def _assert_wait_for_ec2_instances_running() -> list[InstanceTypeDef]:
661660 available = True ,
662661 )
663662 # update our fake node
664- fake_attached_node .spec .labels [
665- _OSPARC_SERVICES_READY_DATETIME_LABEL_KEY
666- ] = mock_docker_tag_node . call_args_list [ 1 ][ 1 ][ "tags" ][
667- _OSPARC_SERVICES_READY_DATETIME_LABEL_KEY
668- ]
663+ fake_attached_node .spec .labels [_OSPARC_SERVICES_READY_DATETIME_LABEL_KEY ] = (
664+ mock_docker_tag_node . call_args_list [ 1 ][ 1 ][ "tags" ][
665+ _OSPARC_SERVICES_READY_DATETIME_LABEL_KEY
666+ ]
667+ )
669668 mock_docker_tag_node .reset_mock ()
670669 mock_docker_set_node_availability .assert_not_called ()
671670
@@ -852,9 +851,9 @@ async def _assert_wait_for_ec2_instances_running() -> list[InstanceTypeDef]:
852851 if not with_drain_nodes_labelled :
853852 fake_attached_node .spec .availability = Availability .drain
854853 fake_attached_node .spec .labels [_OSPARC_SERVICE_READY_LABEL_KEY ] = "false"
855- fake_attached_node .spec .labels [
856- _OSPARC_SERVICES_READY_DATETIME_LABEL_KEY
857- ] = datetime . datetime . now ( tz = datetime . UTC ). isoformat ( )
854+ fake_attached_node .spec .labels [_OSPARC_SERVICES_READY_DATETIME_LABEL_KEY ] = (
855+ datetime . datetime . now ( tz = datetime . UTC ). isoformat ()
856+ )
858857
859858 # the node will not be terminated before the timeout triggers
860859 assert app_settings .AUTOSCALING_EC2_INSTANCES
@@ -1150,7 +1149,7 @@ async def test_cluster_scaling_up_and_down_against_aws(
11501149 cpus = 5 , ram = TypeAdapter (ByteSize ).validate_python ("36Gib" )
11511150 ),
11521151 num_services = 10 ,
1153- expected_instance_type = "g3 .4xlarge" , # 1 GPU, 16 CPUs, 122GiB
1152+ expected_instance_type = "r5n .4xlarge" , # 1 GPU, 16 CPUs, 128GiB
11541153 expected_num_instances = 4 ,
11551154 ),
11561155 id = "sim4life-light" ,
@@ -1238,12 +1237,12 @@ async def test_cluster_scaling_up_starts_multiple_instances(
12381237 [
12391238 pytest .param (
12401239 _ScaleUpParams (
1241- imposed_instance_type = "g3.4xlarge " , # 1 GPU, 16 CPUs, 122GiB
1240+ imposed_instance_type = "g4dn.2xlarge " , # 1 GPU, 8 CPUs, 32GiB
12421241 service_resources = Resources (
1243- cpus = 16 , ram = TypeAdapter (ByteSize ).validate_python ("30Gib " )
1242+ cpus = 8 , ram = TypeAdapter (ByteSize ).validate_python ("15Gib " )
12441243 ),
12451244 num_services = 12 ,
1246- expected_instance_type = "g3.4xlarge " , # 1 GPU, 16 CPUs, 122GiB
1245+ expected_instance_type = "g4dn.2xlarge " , # 1 GPU, 8 CPUs, 32GiB
12471246 expected_num_instances = 10 ,
12481247 ),
12491248 _ScaleUpParams (
@@ -2300,9 +2299,9 @@ async def test_warm_buffers_only_replace_hot_buffer_if_service_is_started_issue7
23002299 # simulate one of the hot buffer is not drained anymore and took the pending service
23012300 random_fake_node = random .choice (fake_hot_buffer_nodes ) # noqa: S311
23022301 random_fake_node .spec .labels [_OSPARC_SERVICE_READY_LABEL_KEY ] = "true"
2303- random_fake_node .spec .labels [
2304- _OSPARC_SERVICES_READY_DATETIME_LABEL_KEY
2305- ] = arrow . utcnow (). isoformat ( )
2302+ random_fake_node .spec .labels [_OSPARC_SERVICES_READY_DATETIME_LABEL_KEY ] = (
2303+ arrow . utcnow (). isoformat ()
2304+ )
23062305 random_fake_node .spec .availability = Availability .active
23072306 # simulate the fact that the warm buffer that just started is not yet visible
23082307 mock_find_node_with_name_returns_fake_node .return_value = None
0 commit comments