From 93eabf3558c5d3a3620fbed4a38fb28aff8e424e Mon Sep 17 00:00:00 2001 From: John McDole Date: Tue, 17 Sep 2024 12:17:06 -0700 Subject: [PATCH] Uninstall /can fail/ (#155314) Error != Exception. Fixes #149666 --- .../bin/tasks/flutter_engine_group_performance.dart | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/dev/devicelab/bin/tasks/flutter_engine_group_performance.dart b/dev/devicelab/bin/tasks/flutter_engine_group_performance.dart index 5ba8eb091b..bd69b708db 100644 --- a/dev/devicelab/bin/tasks/flutter_engine_group_performance.dart +++ b/dev/devicelab/bin/tasks/flutter_engine_group_performance.dart @@ -20,13 +20,7 @@ Future _withApkInstall( final DeviceDiscovery devices = DeviceDiscovery(); final AndroidDevice device = await devices.workingDevice as AndroidDevice; await device.unlock(); - try { - // Force proper cleanup before trying to install app. If uninstall fails, - // we log exception and proceed with running the test. - await device.adb(['uninstall', bundleName]); - } on Exception catch (error) { - print('adb uninstall failed with exception: $error. Will proceed with test run.'); - } + await device.adb(['uninstall', bundleName], canFail: true); await device.adb(['install', '-r', apkPath]); try { await body(device);