Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use onIdle to avoid a race in FlowTests #5202

Merged
merged 2 commits into from
Jul 3, 2023
Merged

Commits on Jul 3, 2023

  1. Use onIdle to avoid a race in FlowTests

    Glide's executor thread notifies the flow in a loop while holding a lock
    on the resource. When it finishes, it releases the lock.
    
    If the flow wins the race and runs before Glide's executor releases the
    lock, the resource will not be recycled in the remainder of the test
    method. If the executor wins the race and releases the lock first, then
    the resource will be recycled in the rest of the test method.
    
    To fix this race, I've used Espresso's onIdle and idling resources,
    similar to the compose rule.
    sjudd committed Jul 3, 2023
    Configuration menu
    Copy the full SHA
    3e7ca89 View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    5bb8c9c View commit details
    Browse the repository at this point in the history