@@ -196,6 +196,20 @@ def test_load_test_autostop(self):
196196 autostop_error_rate_time_window = - 1 ,
197197 )
198198
199+ # Invalid autostop test case: autostop maximum VU per engine = 0
200+ _configure_command_assert_exception (
201+ self ,
202+ "Autostop maximum users per engine should be greater than 0" ,
203+ autostop_maximum_vu_per_engine = 0 ,
204+ )
205+
206+ # Invalid autostop test case: autostop maximum VU per engine < 0
207+ _configure_command_assert_exception (
208+ self ,
209+ "Autostop maximum users per engine should be greater than 0" ,
210+ autostop_maximum_vu_per_engine = 0 ,
211+ )
212+
199213 # Invalid autostop test case: autostop error rate time window not of integer type
200214 # This is not needed as the argument is type checked
201215 # argument --autostop-time-window: invalid int value: '90.4'
@@ -204,7 +218,7 @@ def test_load_test_autostop(self):
204218 # Invalid autostop from config test case: autostop random string
205219 _configure_command_assert_exception (
206220 self ,
207- "Invalid value for autoStop. Valid values are 'disable' or an object with errorPercentage and timeWindow " ,
221+ "Invalid value for autoStop. Valid values are 'disable' or an object with errorPercentage, timeWindow and/or maximumVirtualUsersPerEngine " ,
208222 load_test_config_file = LoadTestConstants .LOAD_TEST_CONFIG_FILE_WITH_INVALID_AUTOSTOP ,
209223 )
210224
@@ -222,13 +236,21 @@ def test_load_test_autostop(self):
222236 load_test_config_file = LoadTestConstants .LOAD_TEST_CONFIG_FILE_WITH_INVALID_AUTOSTOP_TIME_WINDOW ,
223237 )
224238
239+ # Invalid autostop from config test case: autostop time window < 0
240+ _configure_command_assert_exception (
241+ self ,
242+ "Invalid value for maximumVirtualUserPerEngine. Value should be an integer greater than 0" ,
243+ load_test_config_file = LoadTestConstants .LOAD_TEST_CONFIG_FILE_WITH_INVALID_AUTOSTOP_MAX_VU_PER_ENGINE ,
244+ )
245+
225246
226247def _configure_command_jmes_checks (
227248 self ,
228249 checks ,
229250 autostop = None ,
230251 autostop_error_rate = None ,
231252 autostop_error_rate_time_window = None ,
253+ autostop_maximum_vu_per_engine = None ,
232254 load_test_config_file = None ,
233255):
234256 command = (
@@ -258,6 +280,13 @@ def _configure_command_jmes_checks(
258280 }
259281 )
260282 command += "--autostop-time-window {autostop_error_rate_time_window} "
283+ if autostop_maximum_vu_per_engine is not None :
284+ self .kwargs .update (
285+ {
286+ "autostop_maximum_vu_per_engine" : autostop_maximum_vu_per_engine ,
287+ }
288+ )
289+ command += "--autostop-engine-users {autostop_maximum_vu_per_engine} "
261290 if load_test_config_file is not None :
262291 self .kwargs .update (
263292 {
@@ -277,6 +306,7 @@ def _configure_command_assert_exception(
277306 autostop = None ,
278307 autostop_error_rate = None ,
279308 autostop_error_rate_time_window = None ,
309+ autostop_maximum_vu_per_engine = None ,
280310 load_test_config_file = None ,
281311):
282312 command = (
@@ -306,6 +336,13 @@ def _configure_command_assert_exception(
306336 }
307337 )
308338 command += "--autostop-time-window {autostop_error_rate_time_window} "
339+ if autostop_maximum_vu_per_engine is not None :
340+ self .kwargs .update (
341+ {
342+ "autostop_maximum_vu_per_engine" : autostop_maximum_vu_per_engine ,
343+ }
344+ )
345+ command += "--autostop-engine-users {autostop_maximum_vu_per_engine} "
309346 if load_test_config_file is not None :
310347 self .kwargs .update (
311348 {
0 commit comments