From 3e4f1cdf494e09304587f648456f2560d3628fe9 Mon Sep 17 00:00:00 2001 From: John McDole Date: Tue, 27 Aug 2024 09:25:38 -0700 Subject: [PATCH] Uninstall microbenchmarks before running them. (#154183) Flakes in #153828 stem from adb saying the app isn't installed, but then failing to install wtih `-r`. Several other tests uninstall the app before trying to run it. Potential corrects #153828 --- dev/devicelab/lib/tasks/microbenchmarks.dart | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/dev/devicelab/lib/tasks/microbenchmarks.dart b/dev/devicelab/lib/tasks/microbenchmarks.dart index aa38ab9a57..c69da574a5 100644 --- a/dev/devicelab/lib/tasks/microbenchmarks.dart +++ b/dev/devicelab/lib/tasks/microbenchmarks.dart @@ -30,6 +30,18 @@ TaskFunction createMicrobenchmarkTask({ final Directory appDir = dir( path.join(flutterDirectory.path, 'dev/benchmarks/microbenchmarks')); final Process flutterProcess = await inDirectory(appDir, () async { + section('Uninstall microbenchmarks app ($benchmarkPath)'); + + await flutter( + 'install', + options: [ + '-v', + '--uninstall-only', + '-d', + device.deviceId, + ], + ); + final List options = [ '-v', // --release doesn't work on iOS due to code signing issues