Repository navigation
ai tests: the speech in-flight limit check no longer races the 2 second timeout - #3696
Conversation
…ifth conversion asks
|
Caution Review failedThe pull request is closed. Walkthrough
Merge Risk:
|
sha=861206f9bca1e70ec7022b326d0d284ed435b869
🤖 Salam AI reviewVerdict: ✅ Good to merge commit SummaryThis pull request updates the AI API flow test so the speech in-flight limit check no longer depends on request timing. It starts four conversions, waits for them to occupy all slots, then sends the fifth conversion and expects an immediate 503 while the first four time out. The change is test-only and makes the previously flaky assertion deterministic. What changedThe test in ReviewNo blocking issues are visible in the diff. The change directly addresses the described race: the fifth request can no longer arrive after an earlier conversion has already timed out and freed a slot. The resulting status counts still match the assertion, and the test remains focused on behavior rather than implementation details. TestsThis is a test-only change. It adjusts orchestration of existing requests and does not alter production code or add new assertions beyond the existing expected counts. RisksThe test still relies on timing assumptions, including the 500 ms pause and the configured 2 second STT timeout. If the test environment is unusually slow, the pause may not be long enough to guarantee that all four conversions have entered their slots before the fifth request is sent. That risk is much smaller than the original race, but it remains a timing-based assumption.
|
On main the AI job failed one api_flow check after the earlier fixes: "the API's own in-flight limit answers 503" got [504,504,504,504,504] (it passed on the run before).
The check started five conversions at once against the hung speech mock with AI_STT_TIMEOUT_SECONDS=2 and 4 slots (STT_SLOTS). If the fifth request reaches stt_enter after the first one has already timed out and left its slot, it finds a free slot and also ends in 504, so the result depends on how fast the runner processes the uploads.
The test now starts four conversions, waits 500 ms so they hold all four slots, then sends the fifth, which has to get the immediate 503 speech_busy. The in-flight check for /me still runs while the four are in flight. Test only.
Summary by CodeRabbit