Skip to content

Commit 5c89671

Browse files
committed
Ensure we meet one of our end conditions before exiting
Signed-off-by: Samuel Monson <[email protected]>
1 parent 1fbe7e0 commit 5c89671

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

src/guidellm/scheduler/scheduler.py

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -154,7 +154,14 @@ async def run(
154154
if future.done() and (err := future.exception()) is not None:
155155
raise err
156156

157-
if requests_iter is None and run_info.processing_requests <= 0:
157+
if (
158+
requests_iter is None
159+
and run_info.processing_requests <= 0
160+
and ( # Ensure we have met one of the end conditions
161+
time.time() >= run_info.end_time
162+
or run_info.completed_requests >= run_info.end_number
163+
)
164+
):
158165
# we've exhausted all requests we've wanted to run
159166
# and yielded all responses
160167
break

0 commit comments

Comments
 (0)