Fixed
Status Update
Comments
tc...@google.com <tc...@google.com> #2
Howdy it's jb, who the fuck is this
ap...@google.com <ap...@google.com> #3
Can you provide the below requested information to better understand the issue:
Steps to reproduce
Please provide a sample application or apk to reproduce the issue.
Also kindly mention the steps to be followed for reproducing the issue with the given sample application.
Expected output
Could you please explain the expected behavior.
Current output
Could you please explain the current behavior.
Steps to reproduce
Please provide a sample application or apk to reproduce the issue.
Also kindly mention the steps to be followed for reproducing the issue with the given sample application.
Expected output
Could you please explain the expected behavior.
Current output
Could you please explain the current behavior.
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.