@@ -1797,6 +1797,7 @@ async def test_warm_buffers_are_started_to_replace_missing_hot_buffers(
17971797 minimal_configuration : None ,
17981798 with_instances_machines_hot_buffer : EnvVarsDict ,
17991799 ec2_client : EC2Client ,
1800+ initialized_app : FastAPI ,
18001801 app_settings : ApplicationSettings ,
18011802 ec2_instances_allowed_types_with_only_1_buffered : dict [
18021803 InstanceTypeType , EC2InstanceBootSpecific
@@ -1807,6 +1808,7 @@ async def test_warm_buffers_are_started_to_replace_missing_hot_buffers(
18071808 [int , InstanceTypeType , InstanceStateNameType , list [DockerGenericTag ] | None ],
18081809 Awaitable [list [str ]],
18091810 ],
1811+ spied_cluster_analysis : MockType ,
18101812):
18111813 # pre-requisites
18121814 assert app_settings .AUTOSCALING_EC2_INSTANCES
@@ -1834,3 +1836,16 @@ async def test_warm_buffers_are_started_to_replace_missing_hot_buffers(
18341836 expected_pre_pulled_images = None ,
18351837 instance_filters = None ,
18361838 )
1839+
1840+ # let's autoscale, this should move the warm buffers to hot buffers
1841+ await auto_scale_cluster (
1842+ app = initialized_app , auto_scaling_mode = DynamicAutoscaling ()
1843+ )
1844+ analyzed_cluster = assert_cluster_state (
1845+ spied_cluster_analysis ,
1846+ expected_calls = 1 ,
1847+ expected_num_machines = 0 ,
1848+ )
1849+ assert not analyzed_cluster .active_nodes
1850+ assert analyzed_cluster .buffer_ec2s
1851+ assert len (analyzed_cluster .buffer_ec2s ) == len (buffer_machines )
0 commit comments