File tree Expand file tree Collapse file tree 2 files changed +16
-10
lines changed Expand file tree Collapse file tree 2 files changed +16
-10
lines changed Original file line number Diff line number Diff line change @@ -158,6 +158,22 @@ def test_engine_core(monkeypatch: pytest.MonkeyPatch):
158158 assert len (engine_core .scheduler .waiting ) == 0
159159 assert len (engine_core .scheduler .running ) == 0
160160
161+ # Sending duplicate requests with same request_id
162+ req0 = make_request ()
163+ req1 = make_request ()
164+ req0 .request_id = req1 .request_id = "test"
165+ engine_core .add_request (req0 )
166+
167+ while len (engine_core .step ().outputs ) > 0 :
168+ pass
169+
170+ engine_core .add_request (req1 )
171+ while len (engine_core .step ().outputs ) > 0 :
172+ pass
173+
174+ assert len (engine_core .scheduler .waiting ) == 0
175+ assert len (engine_core .scheduler .running ) == 0
176+
161177
162178@create_new_process_for_each_test ()
163179def test_engine_core_advanced_sampling (monkeypatch : pytest .MonkeyPatch ):
Original file line number Diff line number Diff line change @@ -179,16 +179,6 @@ def step(self) -> EngineCoreOutputs:
179179 scheduler_stats = self .scheduler .make_stats (),
180180 )
181181 scheduler_output = self .scheduler .schedule ()
182-
183- # This case may occur when the only unfinished requests are
184- # structured output requests where the grammar has not finished
185- # compiling yet, so there's nothing to run.
186- if scheduler_output .total_num_scheduled_tokens == 0 :
187- return EngineCoreOutputs (
188- outputs = [],
189- scheduler_stats = self .scheduler .make_stats (),
190- )
191-
192182 output = self .model_executor .execute_model (scheduler_output )
193183 engine_core_outputs = self .scheduler .update_from_output (
194184 scheduler_output , output ) # type: ignore
You can’t perform that action at this time.
0 commit comments