From 093aa56a9be91c5efd8dd44895c6e7321a2fb42c Mon Sep 17 00:00:00 2001 From: yusuf-goog <91688203+yusuf-goog@users.noreply.github.com> Date: Mon, 16 Oct 2023 16:41:14 -0700 Subject: [PATCH] Adding a wait for device ready before deleting packages. (#3167) Adding an additional wait, since we experienced a package manager not ready error. Bug:flutter/flutter#135035 *Replace this paragraph with a description of what this PR is changing or adding, and why. Consider including before/after screenshots.* *List which issues are fixed by this PR. You must list at least one issue.* *If you had to change anything in the [flutter/tests] repo, include a link to the migration guide as per the [breaking change policy].* --- cipd_packages/device_doctor/lib/src/android_device.dart | 2 ++ 1 file changed, 2 insertions(+) diff --git a/cipd_packages/device_doctor/lib/src/android_device.dart b/cipd_packages/device_doctor/lib/src/android_device.dart index 78162acf3..fd8b8ebd2 100644 --- a/cipd_packages/device_doctor/lib/src/android_device.dart +++ b/cipd_packages/device_doctor/lib/src/android_device.dart @@ -453,6 +453,8 @@ class AndroidDevice implements Device { processManager ??= LocalProcessManager(); final int timeoutSecs = 60; print('Device recovery: deleting package caches...'); + await eval('adb', ['wait-for-device'], canFail: false, processManager: processManager) + .timeout(Duration(seconds: timeoutSecs)); await deletePackageCache(); await eval('adb', ['wait-for-device'], canFail: false, processManager: processManager) .timeout(Duration(seconds: timeoutSecs));