-
Notifications
You must be signed in to change notification settings - Fork 29.2k
Description
Type of Request
bug
Infrastructure Environment
Github, LUCI, flutter/packages
What is happening?
The file_selector_android
integration test was failing often and was seemingly fixed by closing any system dialogs before running a test: flutter/packages#5805.
The flakiness seems to have started some time after moving the Android Emulator to API 34: flutter/packages#5218. However it recently started failing more consistently.
Other Android plugin integration tests may also be flaking due to this. I'm also not entirely sure if this is an issue with infra, Android 34, or Flutter integration tests.
Related link: https://stackoverflow.com/questions/39457305/android-testing-waited-for-the-root-of-the-view-hierarchy-to-have-window-focus
Steps to reproduce
Running the integration tests in file_selector_android
on CI without the changes made in flutter/packages#5805. The test seems to always pass when ran locally.
To run it locally after downloading the flutter/packages
repo
cd packages/file_selector/file_selector_android/example
flutter build apk
cd android
./gradlew app:connectedAndroidTest -Pandroid.testInstrumentationRunnerArguments.notAnnotation=io.flutter.plugins.DartIntegrationTest
Expected results
The tests should pass, but it ends with error:
dev.flutter.packages.file_selector_android_example.FileSelectorAndroidTest > openImageFile[android_34_google_apis_x64(AVD) - 14] �[31mFAILED �[0m
androidx.test.espresso.base.RootViewPicker$RootViewWithoutFocusException: Waited for the root of the view hierarchy to have window focus and not request layout for 10 seconds. If you specified a non default root matcher, it may be picking a root that never takes focus. Root:
Root{application-window-token=android.view.ViewRootImpl$W@c8cc8b3, window-token=android.view.ViewRootImpl$W@c8cc8b3, has-window-focus=false, layout-params-type=1, layout-params-string={(0,0)(fillxfill) sim={adjust=resize forwardNavigation} ty=BASE_APPLICATION wanim=0x1030001
It seems unnecessary that we would have to clear system dialogs before each test.