From 034a9963c8d9b29c90a4cd2273864b444e67265c Mon Sep 17 00:00:00 2001 From: Anton Malinskiy Date: Fri, 12 Jan 2024 20:19:58 +1000 Subject: [PATCH] fix(android): AmInstrumentTestParser should prepare device once per parsing attempt (#881) --- .../marathon/android/adam/AmInstrumentTestParser.kt | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/vendor/vendor-android/src/main/kotlin/com/malinskiy/marathon/android/adam/AmInstrumentTestParser.kt b/vendor/vendor-android/src/main/kotlin/com/malinskiy/marathon/android/adam/AmInstrumentTestParser.kt index d60ded19a..24630a589 100644 --- a/vendor/vendor-android/src/main/kotlin/com/malinskiy/marathon/android/adam/AmInstrumentTestParser.kt +++ b/vendor/vendor-android/src/main/kotlin/com/malinskiy/marathon/android/adam/AmInstrumentTestParser.kt @@ -61,6 +61,9 @@ class AmInstrumentTestParser( vendorConfiguration: VendorConfiguration.AndroidConfiguration, testBundles: List ): List { + val androidAppInstaller = AndroidAppInstaller(configuration) + androidAppInstaller.prepareInstallation(device) + return testBundles.flatMap { bundle -> val androidTestBundle = AndroidTestBundle(bundle.application, bundle.testApplication, bundle.extraApplications, bundle.splitApks) @@ -82,8 +85,6 @@ class AmInstrumentTestParser( supportedFeatures = device.supportedFeatures, coroutineScope = device, ) - val androidAppInstaller = AndroidAppInstaller(configuration) - androidAppInstaller.prepareInstallation(device) val channel = device.executeTestRequest(runnerRequest) var observedAnnotations = false