@@ -707,12 +707,27 @@ def test_concurrency_validation_with_request_rate():
707707 )
708708
709709
710- def test_concurrency_validation_applies_against_default_request_count ():
711- """Test that concurrency validation applies even when request_count uses default value."""
712- # When concurrency exceeds the default request_count, validation should fail
710+ def test_concurrency_validation_skipped_when_request_count_not_set ():
711+ """Test that concurrency validation is skipped when request_count is not explicitly set."""
712+ config = UserConfig (
713+ endpoint = EndpointConfig (
714+ model_names = ["test-model" ],
715+ type = EndpointType .CHAT ,
716+ custom_endpoint = "test" ,
717+ ),
718+ loadgen = LoadGeneratorConfig (
719+ concurrency = 100 ,
720+ request_rate = 10.0 ,
721+ ),
722+ )
723+ assert config .loadgen .concurrency == 100
724+
725+
726+ def test_concurrency_validation_applies_when_request_count_set ():
727+ """Test that concurrency validation applies when request_count is explicitly set."""
713728 with pytest .raises (
714729 ValueError ,
715- match = "Concurrency \\ (100\\ ) cannot be greater than the request count \\ (10 \\ )" ,
730+ match = "Concurrency \\ (100\\ ) cannot be greater than the request count \\ (50 \\ )" ,
716731 ):
717732 UserConfig (
718733 endpoint = EndpointConfig (
@@ -722,5 +737,23 @@ def test_concurrency_validation_applies_against_default_request_count():
722737 ),
723738 loadgen = LoadGeneratorConfig (
724739 concurrency = 100 ,
740+ request_count = 50 ,
725741 ),
726742 )
743+
744+
745+ def test_concurrency_validation_with_duration_benchmarking ():
746+ """Test that concurrency validation is skipped with duration-based benchmarking."""
747+ config = UserConfig (
748+ endpoint = EndpointConfig (
749+ model_names = ["test-model" ],
750+ type = EndpointType .CHAT ,
751+ custom_endpoint = "test" ,
752+ ),
753+ loadgen = LoadGeneratorConfig (
754+ concurrency = 100 ,
755+ benchmark_duration = 60 ,
756+ ),
757+ )
758+ assert config .loadgen .concurrency == 100
759+ assert config .loadgen .benchmark_duration == 60
0 commit comments