mirror of
https://github.com/flutter/flutter.git
synced 2025-06-03 00:51:18 +00:00
![]() ## `integration_ui_keyboard_resize` flakiness reduction This PR addresses flakiness in the `integration_ui_keyboard_resize` test (issue #161300) and slightly improves its performance. **Issue summary:** The `integration_ui_keyboard_resize` test occasionally fails because the device keyboard does not reliably open at the start of the test. This PR mitigates one cause of this flakiness, though other potential underlying issues may still exist. See #161300 for a detailed investigation. **Changes and rationale:** 1. **Improved keyboard detection logic (flakiness reduction):** * The core change moves `await driver.tap(defaultTextField);` *inside* the loop that checks for layout changes. This ensures the test repeatedly attempts to open the keyboard *while* waiting for the expected layout shift, significantly improving reliability. * **Local testing results (MacBook Pro M1 + Pixel 8 Pro):** * **Original implementation:** Consistent failures within the first 15 iterations. * **This PR:** Ran consistently for at least 300 iterations (out of 2000) before any failure, with some runs exceeding 900 iterations. 2. **`enableTextEntryEmulation` configuration improvement:** * The `keyboard_resize.dart` app is *exclusively* used for testing and requires `enableTextEntryEmulation: false` for proper device keyboard interaction. * This PR sets `enableTextEntryEmulation: false` directly within the app's `enableFlutterDriverExtension` setup. This simplifies the test setup, avoids cross-thread communication, and prevents the app from appearing broken when run independently (as manual text input wouldn't work otherwise). 3. **UI enhancements for manual testing:** * Added `SafeArea` and `InputDecoration` to `keyboard_resize.dart`. This ensures the `TextField` is fully visible and usable during manual testing (it was previously obscured by the Android status bar). This improves the developer experience when debugging the app directly. 4. **Optimized polling for speed:** * Reduced the polling interval and increased the number of polling iterations (maintaining the overall timeout). This change resulted in a ~2-second speed improvement per test iteration during local testing. **Further flakiness improvement discussion and ideas** See the discussion at https://github.com/flutter/flutter/issues/161300 **Testing and reproduction:** To reproduce the original flakiness and verify the fix (reproducibility may vary based on setup; see https://github.com/flutter/flutter/issues/161300#issuecomment-2618952501): 1. **Disable automatic reboots:** Comment out the `await checkForRebootRequired();` line in |
||
---|---|---|
.. | ||
commands_debug_paint_test.dart | ||
commands_none_test.dart | ||
commands_performance_overlay_test.dart | ||
defines_test.dart | ||
driver_test.dart | ||
empty_test.dart | ||
frame_number_test.dart | ||
keyboard_resize_test.dart | ||
keyboard_textfield_test.dart | ||
license_check_test.dart | ||
route_test.dart | ||
solid_color_test.dart |