Decrease device discovery timeout from 10 to 5 seconds (#69266)
diff --git a/dev/devicelab/lib/framework/adb.dart b/dev/devicelab/lib/framework/adb.dart
index a8e5d45..ba7dd82 100644
--- a/dev/devicelab/lib/framework/adb.dart
+++ b/dev/devicelab/lib/framework/adb.dart
@@ -636,7 +636,7 @@
Future<List<String>> discoverDevices() async {
final List<dynamic> results = json.decode(await eval(
path.join(flutterDirectory.path, 'bin', 'flutter'),
- <String>['devices', '--machine', '--suppress-analytics', '--device-timeout', '10'],
+ <String>['devices', '--machine', '--suppress-analytics', '--device-timeout', '5'],
)) as List<dynamic>;
// [
diff --git a/dev/devicelab/lib/framework/utils.dart b/dev/devicelab/lib/framework/utils.dart
index a1cbcc0..3fa1310 100644
--- a/dev/devicelab/lib/framework/utils.dart
+++ b/dev/devicelab/lib/framework/utils.dart
@@ -434,7 +434,7 @@
List<String> flutterCommandArgs(String command, List<String> options) {
// Commands support the --device-timeout flag.
- final List<String> supportedDeviceTimeoutCommands = <String>[
+ final Set<String> supportedDeviceTimeoutCommands = <String>{
'attach',
'devices',
'drive',
@@ -442,13 +442,13 @@
'logs',
'run',
'screenshot',
- ];
+ };
return <String>[
command,
if (deviceOperatingSystem == DeviceOperatingSystem.ios && supportedDeviceTimeoutCommands.contains(command))
...<String>[
'--device-timeout',
- '10',
+ '5',
],
if (localEngine != null) ...<String>['--local-engine', localEngine],
if (localEngineSrcPath != null) ...<String>['--local-engine-src-path', localEngineSrcPath],
diff --git a/dev/devicelab/lib/tasks/perf_tests.dart b/dev/devicelab/lib/tasks/perf_tests.dart
index 39a5a2c..12e0083 100644
--- a/dev/devicelab/lib/tasks/perf_tests.dart
+++ b/dev/devicelab/lib/tasks/perf_tests.dart
@@ -771,7 +771,7 @@
'run',
if (deviceOperatingSystem == DeviceOperatingSystem.ios)
...<String>[
- '--device-timeout', '10',
+ '--device-timeout', '5',
],
'--verbose',
'--verbose-system-logs',