[Bugfix] Restore MRV2 full-payload transport for offline Qwen3-TTS (#8010)
Signed-off-by: Sy03 <1370724210@qq.com>
This commit is contained in:
13 files changed
+284
-26
No files matched your search
@@ -2000,6 +2000,47 @@ async def test_abort_retry_does_not_repeat_successful_stage_abort():
|
||||
assert second.bound == set()
|
||||
|
||||
|
||||
@pytest.mark.asyncio
|
||||
@pytest.mark.parametrize("stage_id", [0, 1])
|
||||
async def test_raw_stage_error_reaches_caller_before_normal_terminal_routing(mocker, stage_id):
|
||||
pools = _build_stage_pools([[FakeStageClient()], [FakeStageClient()]])
|
||||
for pool in pools:
|
||||
mocker.patch.object(pool, "process_llm_raw_outputs", new_callable=mocker.AsyncMock, return_value=[])
|
||||
output_queue: asyncio.Queue[ErrorMessage] = asyncio.Queue()
|
||||
orchestrator = Orchestrator(
|
||||
request_async_queue=asyncio.Queue(),
|
||||
output_async_queue=output_queue,
|
||||
rpc_async_queue=asyncio.Queue(),
|
||||
stage_pools=[],
|
||||
)
|
||||
orchestrator.stage_pools = pools
|
||||
orchestrator.request_states["stuck"] = OrchestratorRequestState(request_id="stuck", final_stage_id=1)
|
||||
mocker.patch.object(orchestrator, "_handle_kv_ready_raw_outputs", new_callable=mocker.AsyncMock)
|
||||
cleanup = mocker.patch.object(orchestrator, "_cleanup_request_ids", new_callable=mocker.AsyncMock)
|
||||
normal_terminal = mocker.patch.object(
|
||||
orchestrator, "_apply_raw_terminal_stage_finish", new_callable=mocker.AsyncMock
|
||||
)
|
||||
reason = "Timed out waiting for connector input after 5s"
|
||||
raw = EngineCoreOutputs(
|
||||
outputs=[
|
||||
OmniEngineCoreOutput(
|
||||
request_id="stuck", new_token_ids=[], finish_reason=FinishReason.ERROR, stop_reason=reason
|
||||
)
|
||||
]
|
||||
)
|
||||
terminal_ids: set[str] = set()
|
||||
|
||||
await orchestrator._process_llm_stage_outputs(stage_id, 0, raw, terminal_ids)
|
||||
|
||||
error = output_queue.get_nowait()
|
||||
assert isinstance(error, ErrorMessage)
|
||||
assert (error.request_id, error.stage_id, error.error) == ("stuck", stage_id, reason)
|
||||
cleanup.assert_awaited_once_with(["stuck"], abort=True, release_owners=True)
|
||||
normal_terminal.assert_not_awaited()
|
||||
assert not terminal_ids
|
||||
assert output_queue.empty()
|
||||
|
||||
|
||||
@pytest.mark.asyncio
|
||||
async def test_duplex_session_request_error_finish_is_delivered_as_request_error() -> None:
|
||||
"""A session-owned request the scheduler finished with FinishReason.ERROR
|
||||
|
||||
Reference in new issue
Block a user