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

Clear Choreographer.getInstance for all Loopers. #8884

Closed
wants to merge 0 commits into from

Conversation

copybara-service[bot]
Copy link

Clear Choreographer.getInstance for all Loopers.

Previously Robolectric would attempt to clear Choreographer.getInstance in a resetter method.
However, the Choreographer instance is a ThreadLocal, so when the resetter would have no effect when
running in INSTRUMENTATION_TEST LooperMode, or if a Choreographer was used on another Looper thread.
This can lead to hard-to-debug test pollution issues where Choreographer vsync callbacks don't occur as expected.

This commit changes the reset logic to clear Choreographer.getInstance for all active Looper threads.

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.

None yet

0 participants