@@ -48,6 +48,7 @@ def pool_configs():
4848 "max_weight_to_add" : 200 ,
4949 "max_weight_to_remove" : 10 ,
5050 },
51+ "alert_on_max_capacity" : True ,
5152 },
5253 namespace = POOL_NAMESPACE .format (pool = "bar" , scheduler = "mesos" ),
5354 ):
@@ -86,6 +87,10 @@ def mock_autoscaler():
8687 "scaling_limits.max_capacity" ,
8788 namespace = POOL_NAMESPACE .format (pool = "bar" , scheduler = "mesos" ),
8889 )
90+ mock_autoscaler .pool_manager .alert_on_max_capacity = staticconf .read_bool (
91+ "alert_on_max_capacity" ,
92+ namespace = POOL_NAMESPACE .format (pool = "bar" , scheduler = "mesos" ),
93+ )
8994 mock_autoscaler .pool_manager .non_orphan_fulfilled_capacity = 0
9095
9196 mock_autoscaler .target_capacity_gauge = mock .Mock (spec = GaugeProtocol )
@@ -155,7 +160,7 @@ def test_autoscaler_run(dry_run, mock_autoscaler, run_timestamp):
155160
156161 assert mock_autoscaler .target_capacity_gauge .set .call_args == mock .call (100 , {"dry_run" : dry_run })
157162 assert mock_autoscaler .max_capacity_gauge .set .call_args == mock .call (
158- mock_autoscaler .pool_manager .max_capacity , {"dry_run" : dry_run }
163+ mock_autoscaler .pool_manager .max_capacity , {"dry_run" : dry_run , "alert_on_max_capacity" : True }
159164 )
160165 assert mock_autoscaler .setpoint_gauge .set .call_args == mock .call (0.7 , {"dry_run" : dry_run })
161166 assert mock_autoscaler ._compute_target_capacity .call_args == mock .call (resource_request )
0 commit comments