Skip to content

Conversation

@copybara-service
Copy link

Fix deadlock in espresso in Robolectric INSTRUMENTATION_TEST + paused looper.

When running tests in Robolectric's INSTRUMENTATION_TEST LooperMode
and explicitly pausing the main looper, Espresso will deadlock if part of its
AsyncTask initialization occurs on the test thread.

Fix this by adding a call to explict call to ControlledLooper.drainMainThreadWhenIdle.

… looper.

When running tests in Robolectric's INSTRUMENTATION_TEST LooperMode
and explicitly pausing the main looper, Espresso will deadlock if part of its
AsyncTask initialization occurs on the test thread.

Fix this by adding a call to explict call to ControlledLooper.drainMainThreadWhenIdle.

PiperOrigin-RevId: 704231969
@copybara-service copybara-service bot merged commit a9629d1 into main Dec 9, 2024
@copybara-service copybara-service bot deleted the piper_703634484 branch December 9, 2024 12:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant