Skip to content

Commit 851d7a7

Browse files
committed
ongoing
1 parent c9b5771 commit 851d7a7

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed

services/autoscaling/tests/unit/test_modules_auto_scaling_dynamic.py

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -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

Comments
 (0)