From 705dfb8e5c73918060f116decf6de8f5ca6259da Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=81=B5=E5=BA=94?= Date: Thu, 9 Jul 2026 14:40:27 +0800 Subject: [PATCH] =?UTF-8?q?fix(test):=20=E4=BF=AE=E5=A4=8DTTS=E7=94=9F?= =?UTF-8?q?=E5=91=BD=E5=91=A8=E6=9C=9F=E6=B5=8B=E8=AF=95=E9=87=8D=E5=A4=8D?= =?UTF-8?q?mark=5Fprocessing=E7=9A=84=E7=8A=B6=E6=80=81=E8=BD=AC=E6=8D=A2?= =?UTF-8?q?=E9=94=99=E8=AF=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- tests/integration/test_tts_api.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/tests/integration/test_tts_api.py b/tests/integration/test_tts_api.py index 09cf1171b..69d6e5587 100644 --- a/tests/integration/test_tts_api.py +++ b/tests/integration/test_tts_api.py @@ -865,10 +865,12 @@ class TestTTSLifecycle: # 模拟 worker 完成 job = tts_repo.get(job_id) assert job is not None - # 如果任务因 Celery 调度失败而处于 failed 状态,先重置为 pending + # 根据当前状态决定下一步:failed 先重置,pending 则转 processing,已是 processing 则跳过 if job.status == TTSJobStatus.FAILED: job.prepare_retry() - job.mark_processing() + job.mark_processing() + elif job.status == TTSJobStatus.PENDING: + job.mark_processing() job.mark_completed( output_audio_url="https://cdn.example.com/tts/final.mp3", duration=8.0,