Skip to content

[ Infra ] Frequent flakes due to No Android devices detected #176352

@bkonyi

Description

@bkonyi

Multiple times a week, test shards are failing with logs similar to this:

[2025-09-24 17:54:32.372952] [STDOUT] Executing "/opt/s/w/ir/cache/android/sdk/platform-tools/adb devices -l" in "/opt/s/w/ir/x/w/rc/tmpo9xtcrvl/flutter sdk/dev/devicelab" with environment {BOT: true, LANG: en_US.UTF-8}
[2025-09-24 17:54:32.378026] [STDOUT] stdout: List of devices attached
[2025-09-24 17:54:32.378124] [STDOUT] stdout: 33311FDH3002UE         offline usb:3-7 transport_id:2
[2025-09-24 17:54:32.378142] [STDOUT] stdout: 
[2025-09-24 17:54:32.385859] [STDOUT] Executing "/opt/s/w/ir/cache/android/sdk/platform-tools/adb devices -l" in "/opt/s/w/ir/x/w/rc/tmpo9xtcrvl/flutter sdk/dev/integration_tests/ui" with environment {BOT: true, LANG: en_US.UTF-8}
[2025-09-24 17:54:32.392507] [STDOUT] stdout: List of devices attached
[2025-09-24 17:54:32.392578] [STDOUT] stdout: 33311FDH3002UE         offline usb:3-7 transport_id:2
[2025-09-24 17:54:32.392599] [STDOUT] stdout: 
[2025-09-24 17:54:32.396834] [STDERR] Task failed: DeviceException: No Android devices detected
[2025-09-24 17:54:32.396943] [STDERR] 
[2025-09-24 17:54:32.396968] [STDERR] Stack trace:
[2025-09-24 17:54:32.411184] [STDERR] package:flutter_devicelab/framework/devices.dart 266:7     AndroidDeviceDiscovery.chooseWorkingDevice
[2025-09-24 17:54:32.411259] [STDERR] ===== asynchronous gap ===========================
[2025-09-24 17:54:32.411274] [STDERR] dart:async                                                 _CustomZone.registerBinaryCallback
[2025-09-24 17:54:32.411285] [STDERR] package:flutter_devicelab/framework/framework.dart 309:28  _TaskRunner._performTask.<fn>
[2025-09-24 17:54:32.411295] [STDERR] package:stack_trace                                        Chain.capture
[2025-09-24 17:54:32.411311] [STDERR] package:flutter_devicelab/framework/framework.dart 307:11  _TaskRunner._performTask
[2025-09-24 17:54:32.411323] [STDERR] package:flutter_devicelab/framework/framework.dart 200:43  _TaskRunner.run
[2025-09-24 17:54:32.411336] [STDERR] 
[2025-09-24 17:54:32.411596] [STDOUT] Checking for reboot
[2025-09-24 17:54:32.411938] [STDOUT] Executing "/opt/s/w/ir/cache/android/sdk/platform-tools/adb devices -l" in "/opt/s/w/ir/x/w/rc/tmpo9xtcrvl/flutter sdk/dev/devicelab" with environment {BOT: true, LANG: en_US.UTF-8}
[2025-09-24 17:54:32.416919] [STDOUT] stdout: List of devices attached
[2025-09-24 17:54:32.416987] [STDOUT] stdout: 33311FDH3002UE         offline usb:3-7 transport_id:2
[2025-09-24 17:54:32.417001] [STDOUT] stdout: 
[integration_ui_keyboard_resize] Process terminated with exit code 0.
Task result:
{
  "success": false,
  "reason": "Task failed: DeviceException: No Android devices detected"
}

We should find a better way to deal with these sorts of failures that don't result in flakiness issues being filed for individual shards.

Examples of flakiness issues filed in the past month or two solely due to this error:

Metadata

Metadata

Assignees

No one assigned

    Labels

    c: contributor-productivityTeam-specific productivity, code health, technical debt.team-infraOwned by Infrastructure team

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions