fix(test): 修复TTS生命周期测试重复mark_processing的状态转换错误
CI/CD Pipeline / Production Browser E2E (push) Failing after 1656h47m13s
CI/CD Pipeline / Build Production Runtime Images (push) Failing after 1656h47m17s
CI/CD Pipeline / Validate Code Quality And Tests (push) Has been skipped
CI/CD Pipeline / Frontend Lint (push) Has been skipped
CI/CD Pipeline / Build & Push Staging (Watchtower auto-deploy) (push) Has been skipped
CI/CD Pipeline / Staging E2E Tests (push) Has been skipped
CI/CD Pipeline / Staging API Integration Tests (push) Has been skipped
CI/CD Pipeline / Deploy Production (push) Failing after 1657h18m45s

This commit is contained in:
灵应
2026-07-09 14:40:27 +08:00
parent 766406ebb5
commit 705dfb8e5c
+4 -2
View File
@@ -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,