Change theme
Help
Press space for more information.
Show links for this issue (Shortcut: i, l)
Copy issue ID
Previous Issue (Shortcut: k)
Next Issue (Shortcut: j)
Sign in to use full features.
Vote: I am impacted
Notification menu
Refresh (Shortcut: Shift+r)
Go home (Shortcut: u)
Pending code changes (auto-populated)
View issue level access limits(Press Alt + Right arrow for more information)
Unintended behavior
View staffing
Description
If
ManualFrameClock.advanceClock(nanos: Long)
is called from the main dispatcher, and its awaiters are also dispatched on the main dispatcher, two subsequent calls toadvanceClock
without a suspending call in between will result in the second frame time being missed by the awaiting coroutines.When awaiters get their frame time, their withFrameNanos lambda runs and they will be resumed, but the resume happens dispatched. If the caller is already occupying the main thread, the dispatch is enqueued and can only happen when the caller suspends.
If we yield right after sending the new frame time, the awaiters can be dispatched and potentially suspend on another call to withFrameNanos before the caller of advanceClock moves on.