@@ -39,7 +39,7 @@ def test_interrupted_report(server: VllmSimServer):
39
39
--target "{ server .get_url ()} " \
40
40
--rate-type constant \
41
41
--rate { rate } \
42
- --max-seconds 1000 \
42
+ --max-seconds 60 \
43
43
--max-error { max_error_rate } \
44
44
--data "prompt_tokens=256,output_tokens=128" \
45
45
--output-path { report_path }
@@ -52,37 +52,37 @@ def test_interrupted_report(server: VllmSimServer):
52
52
logger .info ("Waiting for client to start..." )
53
53
time .sleep (5 )
54
54
server .stop ()
55
- logger .info ("Waiting for client to stop..." )
56
- time .sleep (5 )
57
-
58
- logger .info ("Fetching client output" )
59
- stdout , stderr = process .communicate ()
60
- logger .info (f"Client stdout:\n { stdout } " )
61
- logger .info (f"Client stderr:\n { stderr } " )
62
55
63
- assert report_path .exists ()
64
- with report_path .open ("r" ) as f :
65
- report = json .load (f )
56
+ try :
57
+ logger .info ("Fetching client output" )
58
+ stdout , stderr = process .communicate ()
59
+ logger .info (f"Client stdout:\n { stdout } " )
60
+ logger .info (f"Client stderr:\n { stderr } " )
66
61
67
- assert "benchmarks" in report
68
- benchmarks = report ["benchmarks" ]
69
- assert len (benchmarks ) > 0
70
- benchmark = benchmarks [0 ]
71
- assert "requests" in benchmark
72
- requests = benchmark ["requests" ]
73
- assert "successful" in requests
74
- successful = requests ["successful" ]
75
- assert "errored" in requests
76
- errored = requests ["errored" ]
77
- assert len (errored ) / (len (successful ) + len (errored )) > max_error_rate
62
+ assert report_path .exists ()
63
+ with report_path .open ("r" ) as f :
64
+ report = json .load (f )
78
65
79
- report_path .unlink ()
66
+ assert "benchmarks" in report
67
+ benchmarks = report ["benchmarks" ]
68
+ assert len (benchmarks ) > 0
69
+ benchmark = benchmarks [0 ]
70
+ assert "requests" in benchmark
71
+ requests = benchmark ["requests" ]
72
+ assert "successful" in requests
73
+ successful = requests ["successful" ]
74
+ assert "errored" in requests
75
+ errored = requests ["errored" ]
76
+ assert len (errored ) / (len (successful ) + len (errored )) > max_error_rate
77
+ finally :
78
+ if report_path .exists ():
79
+ report_path .unlink ()
80
80
81
- process .terminate () # Send SIGTERM
82
- try :
83
- process .wait (timeout = 5 ) # Wait for the process to terminate
84
- logger .info ("Client stopped successfully." )
85
- except subprocess .TimeoutExpired :
86
- logger .warning ("Client did not terminate gracefully, killing it..." )
87
- process .kill () # Send SIGKILL if it doesn't terminate
88
- process .wait ()
81
+ process .terminate () # Send SIGTERM
82
+ try :
83
+ process .wait (timeout = 5 ) # Wait for the process to terminate
84
+ logger .info ("Client stopped successfully." )
85
+ except subprocess .TimeoutExpired :
86
+ logger .warning ("Client did not terminate gracefully, killing it..." )
87
+ process .kill () # Send SIGKILL if it doesn't terminate
88
+ process .wait ()
0 commit comments