Skip to content

Android tests flaking: "Task failed: Bad state: Too many elements" #174952

@gaaclarke

Description

@gaaclarke

There has been a recent change that is causing Android tests to flake frequently.

Image

examples

log

[2025-09-04 00:51:56.824797] [STDERR] Task failed: Bad state: Too many elements
[2025-09-04 00:51:56.824943] [STDERR] 
[2025-09-04 00:51:56.825004] [STDERR] Stack trace:
[2025-09-04 00:51:56.855300] [STDERR] dart:core                                                  Iterable.single
[2025-09-04 00:51:56.855376] [STDERR] package:flutter_devicelab/framework/devices.dart 689:73    AndroidDevice._getWakefulness
[2025-09-04 00:51:56.855408] [STDERR] ===== asynchronous gap ===========================
[2025-09-04 00:51:56.855434] [STDERR] dart:async                                                 _CustomZone.registerBinaryCallback
[2025-09-04 00:51:56.855456] [STDERR] package:flutter_devicelab/framework/framework.dart 309:28  _TaskRunner._performTask.<fn>
[2025-09-04 00:51:56.855481] [STDERR] package:stack_trace                                        Chain.capture
[2025-09-04 00:51:56.855501] [STDERR] package:flutter_devicelab/framework/framework.dart 307:11  _TaskRunner._performTask
[2025-09-04 00:51:56.855523] [STDERR] package:flutter_devicelab/framework/framework.dart 200:43  _TaskRunner.run
[2025-09-04 00:51:56.855542] [STDERR] 
[2025-09-04 00:51:56.858367] [STDOUT] Checking for reboot

Metadata

Metadata

Assignees

Labels

P0Critical issues such as a build break or regression

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions