chat-ui
67255d7e - Deflake the runMcpFlow 429 backoff test (#2548)

Commit
60 days ago
Deflake the runMcpFlow 429 backoff test (#2548) Wait for the backoff timer instead of racing it in the 429 spec The rate-limit test advanced fake timers on a fixed 200-iteration budget that a slow runner could exhaust before the flow ever registered its backoff sleep, leaving the fake clock unadvanced and the test hanging to its 30s timeout (flaked on CI run 33462543653). The backoff sleep is the only client of the faked setTimeout, so wait for vi.getTimerCount() to go nonzero — yielding real event-loop turns however long that takes — then advance by exactly RATE_LIMIT_BACKOFF_MS[0]. Reproduced the hang by delaying the scripted 429 behind 2000 event-loop turns: the old loop times out, the hardened one passes in ~50ms.
Author
Parents
Loading