MarathonLabs / marathon

Cross-platform test runner
https://docs.marathonlabs.io
GNU General Public License v2.0
577 stars 120 forks source link

Unable to run in multiple devices #675

Closed phkuroishi closed 2 years ago

phkuroishi commented 2 years ago

Hello. I'm new to Marathon and I'm having some difficulty executing the tests in parallel on different devices. I'm trying to execute the tests using an emulator and a real device, but only the emulator executes the tests. I'm using the following configuration:

name: "HelloWorld" outputDir: "build/reports/marathon" vendorConfiguration: type: "Android" applicationApk: "app/build/outputs/apk/debug/app-debug.apk" testApplicationApk: "app/build/outputs/apk/androidTest/debug/app-debug-androidTest.apk"

The tests execute fine on the emulator. However, on the real device, I'm getting the following error:

> D 15:44:34.926 [main @coroutine#40] <QueueActor[DevicePoolId(name=omni)]> handle test results 127.0.0.1:5037:emulator-5554
D 15:44:34.926 [main @coroutine#40] <QueueActor[DevicePoolId(name=omni)]> request next batch for device 127.0.0.1:5037:emulator-5554
E 15:44:34.936 [main @coroutine#68] <D.0.0.1:5037:0051948259]> Error Job was cancelled
kotlinx.coroutines.JobCancellationException: Job was cancelled
    at kotlinx.coroutines.JobSupport.cancel(JobSupport.kt:1578)
    at kotlinx.coroutines.Job$DefaultImpls.cancel$default(Job.kt:189)
    at com.malinskiy.marathon.execution.DevicePoolActor.terminate(DevicePoolActor.kt:132)
    at com.malinskiy.marathon.execution.DevicePoolActor.onQueueTerminated(DevicePoolActor.kt:88)
    at com.malinskiy.marathon.execution.DevicePoolActor.receive(DevicePoolActor.kt:51)
    at com.malinskiy.marathon.execution.DevicePoolActor.receive(DevicePoolActor.kt:26)
    at com.malinskiy.marathon.actor.Actor$delegate$1.invokeSuspend(Actor.kt:31)
    (Coroutine boundary)
    at com.malinskiy.marathon.execution.device.DeviceActor$initialize$2$1.invokeSuspend(DeviceActor.kt:165)
    at com.malinskiy.marathon.execution.RetryKt.withRetry(Retry.kt:11)
    at com.malinskiy.marathon.execution.device.DeviceActor$initialize$2.invokeSuspend(DeviceActor.kt:162)
Caused by: kotlinx.coroutines.JobCancellationException: Job was cancelled
    at kotlinx.coroutines.JobSupport.cancel(JobSupport.kt:1578)
    at kotlinx.coroutines.Job$DefaultImpls.cancel$default(Job.kt:189)
    at com.malinskiy.marathon.execution.DevicePoolActor.terminate(DevicePoolActor.kt:132)
    at com.malinskiy.marathon.execution.DevicePoolActor.onQueueTerminated(DevicePoolActor.kt:88)
    at com.malinskiy.marathon.execution.DevicePoolActor.receive(DevicePoolActor.kt:51)
    at com.malinskiy.marathon.execution.DevicePoolActor.receive(DevicePoolActor.kt:26)
    at com.malinskiy.marathon.actor.Actor$delegate$1.invokeSuspend(Actor.kt:31)
    at kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith(ContinuationImpl.kt:33)
    at kotlinx.coroutines.DispatchedTask.run(DispatchedTask.kt:106)
    at kotlinx.coroutines.EventLoopImplBase.processNextEvent(EventLoop.common.kt:279)
    at kotlinx.coroutines.BlockingCoroutine.joinBlocking(Builders.kt:85)
    at kotlinx.coroutines.BuildersKt__BuildersKt.runBlocking(Builders.kt:59)
    at kotlinx.coroutines.BuildersKt.runBlocking(Unknown Source)
    at kotlinx.coroutines.BuildersKt__BuildersKt.runBlocking$default(Builders.kt:38)
    at kotlinx.coroutines.BuildersKt.runBlocking$default(Unknown Source)
    at com.malinskiy.marathon.Marathon.run(Marathon.kt:52)
    at com.malinskiy.marathon.cli.ApplicationViewKt$main$1.invoke(ApplicationView.kt:62)
    at com.malinskiy.marathon.cli.ApplicationViewKt$main$1.invoke(ApplicationView.kt:29)
    at com.xenomachina.argparser.SystemExitExceptionKt.mainBody(SystemExitException.kt:74)
    at com.xenomachina.argparser.SystemExitExceptionKt.mainBody$default(SystemExitException.kt:72)
    at com.malinskiy.marathon.cli.ApplicationViewKt.main(ApplicationView.kt:27)
D 15:44:34.937 [main @coroutine#68] <D.0.0.1:5037:0051948259]> terminate 127.0.0.1:5037:0051948259

Looking at the report, I get the following info: https://drive.google.com/file/d/1dFOtbFSlvjBnQez6_L647BpQeqp8hWRn/view?usp=sharing

Am I missing something? I'm currently using Marathon version 0.7.3.

Malinskiy commented 2 years ago

Hi,

It seems like your real device didn’t pass the setup which involves getting some information about the device as well as installing the apks you provide.

The stack trace you’re receiving above is because the test run finished at that point but device still didn’t respond for some reason at com.malinskiy.marathon.execution.DevicePoolActor.onQueueTerminated(DevicePoolActor.kt:88)

I would double check if the device is accessible via the adb using a CLI including actual data transfer

phkuroishi commented 2 years ago

Hi, it seems that my device is ok. I tried to run the tests only on my device, and it works fine. However, when I started the emulator and executed the tests on both devices, I got the same error.

Malinskiy commented 2 years ago

Can you please supply the full log of the test run?

phkuroishi commented 2 years ago

Sure.

10:36:51.170 [main] INFO  c.m.marathon.cli.ApplicationView - Starting marathon v0.7.3
10:36:51.289 [main] INFO  c.m.m.e.BugsnagExceptionsReporter - Init BugSnag
10:36:51.290 [main] INFO  c.m.marathon.cli.ApplicationView - Checking Marathonfile config
I 10:36:52.130 [main @coroutine#1] <com.malinskiy.marathon.Marathon> System Information:
I 10:36:52.131 [main @coroutine#1] <com.malinskiy.marathon.Marathon> java.specification.version: 15
I 10:36:52.131 [main @coroutine#1] <com.malinskiy.marathon.Marathon> java.runtime.version: 15.0.2+7
I 10:36:52.131 [main @coroutine#1] <com.malinskiy.marathon.Marathon> java.class.path: /home/phk/workspace/psgr/tools/marathon-0.7.3/lib/cli-0.7.3.jar:/home/phk/workspace/psgr/tools/marathon-0.7.3/lib/vendor-ios-0.7.3.jar:/home/phk/workspace/psgr/tools/marathon-0.7.3/lib/ddmlib-0.7.3.jar:/home/phk/workspace/psgr/tools/marathon-0.7.3/lib/adam-0.7.3.jar:/home/phk/workspace/psgr/tools/marathon-0.7.3/lib/base-0.7.3.jar:/home/phk/workspace/psgr/tools/marathon-0.7.3/lib/core-0.7.3.jar:/home/phk/workspace/psgr/tools/marathon-0.7.3/lib/usage-0.7.3.jar:/home/phk/workspace/psgr/tools/marathon-0.7.3/lib/configuration-0.7.3.jar:/home/phk/workspace/psgr/tools/marathon-0.7.3/lib/html-report-0.7.3.jar:/home/phk/workspace/psgr/tools/marathon-0.7.3/lib/execution-timeline-0.7.3.jar:/home/phk/workspace/psgr/tools/marathon-0.7.3/lib/ddmlib-30.0.3.jar:/home/phk/workspace/psgr/tools/marathon-0.7.3/lib/common-30.0.3.jar:/home/phk/workspace/psgr/tools/marathon-0.7.3/lib/adam-0.4.5.jar:/home/phk/workspace/psgr/tools/marathon-0.7.3/lib/kotlin-logging-jvm-2.1.23.jar:/home/phk/workspace/psgr/tools/marathon-0.7.3/lib/koin-core-jvm-3.2.0.jar:/home/phk/workspace/psgr/tools/marathon-0.7.3/lib/influxdb-java-2.22.jar:/home/phk/workspace/psgr/tools/marathon-0.7.3/lib/influxdb-client-java-3.4.0.jar:/home/phk/workspace/psgr/tools/marathon-0.7.3/lib/influxdb-client-core-3.4.0.jar:/home/phk/workspace/psgr/tools/marathon-0.7.3/lib/logging-interceptor-4.9.1.jar:/home/phk/workspace/psgr/tools/marathon-0.7.3/lib/vertx-lang-kotlin-4.2.4.jar:/home/phk/workspace/psgr/tools/marathon-0.7.3/lib/vertx-lang-kotlin-coroutines-4.2.4.jar:/home/phk/workspace/psgr/tools/marathon-0.7.3/lib/parser-2.3.4.jar:/home/phk/workspace/psgr/tools/marathon-0.7.3/lib/clikt-jvm-3.1.0.jar:/home/phk/workspace/psgr/tools/marathon-0.7.3/lib/grpc-kotlin-stub-1.2.1.jar:/home/phk/workspace/psgr/tools/marathon-0.7.3/lib/kotlinx-coroutines-core-jvm-1.6.0.jar:/home/phk/workspace/psgr/tools/marathon-0.7.3/lib/kotlin-stdlib-jdk8-1.5.21.jar:/home/phk/workspace/psgr/tools/marathon-0.7.3/lib/allure-kotlin-commons-2.4.0.jar:/home/phk/workspace/psgr/tools/marathon-0.7.3/lib/bugsnag-3.6.3.jar:/home/phk/workspace/psgr/tools/marathon-0.7.3/lib/jackson-dataformat-yaml-2.13.1.jar:/home/phk/workspace/psgr/tools/marathon-0.7.3/lib/jackson-datatype-jsr310-2.13.1.jar:/home/phk/workspace/psgr/tools/marathon-0.7.3/lib/jackson-databind-2.13.1.jar:/home/phk/workspace/psgr/tools/marathon-0.7.3/lib/jackson-annotations-2.13.1.jar:/home/phk/workspace/psgr/tools/marathon-0.7.3/lib/vertx-core-4.2.4.jar:/home/phk/workspace/psgr/tools/marathon-0.7.3/lib/jackson-core-2.13.1.jar:/home/phk/workspace/psgr/tools/marathon-0.7.3/lib/jackson-module-kotlin-2.13.1.jar:/home/phk/workspace/psgr/tools/marathon-0.7.3/lib/kotlin-reflect-1.5.21.jar:/home/phk/workspace/psgr/tools/marathon-0.7.3/lib/logback-classic-1.2.11.jar:/home/phk/workspace/psgr/tools/marathon-0.7.3/lib/kotlin-argparser-2.0.7.jar:/home/phk/workspace/psgr/tools/marathon-0.7.3/lib/allure-test-filter-2.18.1.jar:/home/phk/workspace/psgr/tools/marathon-0.7.3/lib/allure-environment-writer-1.0.0.jar:/home/phk/workspace/psgr/tools/marathon-0.7.3/lib/allure-testng-2.8.1.jar:/home/phk/workspace/psgr/tools/marathon-0.7.3/lib/allure-descriptions-javadoc-2.8.1.jar:/home/phk/workspace/psgr/tools/marathon-0.7.3/lib/allure-java-commons-2.18.1.jar:/home/phk/workspace/psgr/tools/marathon-0.7.3/lib/gson-fire-1.8.4.jar:/home/phk/workspace/psgr/tools/marathon-0.7.3/lib/converter-gson-2.9.0.jar:/home/phk/workspace/psgr/tools/marathon-0.7.3/lib/grpc-okhttp-1.44.0.jar:/home/phk/workspace/psgr/tools/marathon-0.7.3/lib/grpc-core-1.44.0.jar:/home/phk/workspace/psgr/tools/marathon-0.7.3/lib/gson-2.9.0.jar:/home/phk/workspace/psgr/tools/marathon-0.7.3/lib/rsync4j-all-3.2.3-10.jar:/home/phk/workspace/psgr/tools/marathon-0.7.3/lib/rsync4j-windows32-3.2.3-10.jar:/home/phk/workspace/psgr/tools/marathon-0.7.3/lib/rsync4j-windows64-3.2.3-10.jar:/home/phk/workspace/psgr/tools/marathon-0.7.3/lib/rsync4j-core-3.2.3-10.jar:/home/phk/workspace/psgr/tools/marathon-0.7.3/lib/commons-io-2.11.0.jar:/home/phk/workspace/psgr/tools/marathon-0.7.3/lib/dd-plist-1.23.jar:/home/phk/workspace/psgr/tools/marathon-0.7.3/lib/axmlparser-1.0.jar:/home/phk/workspace/psgr/tools/marathon-0.7.3/lib/grpc-protobuf-lite-1.44.0.jar:/home/phk/workspace/psgr/tools/marathon-0.7.3/lib/grpc-stub-1.44.0.jar:/home/phk/workspace/psgr/tools/marathon-0.7.3/lib/grpc-api-1.44.0.jar:/home/phk/workspace/psgr/tools/marathon-0.7.3/lib/guava-31.1-jre.jar:/home/phk/workspace/psgr/tools/marathon-0.7.3/lib/sshj-0.33.0.jar:/home/phk/workspace/psgr/tools/marathon-0.7.3/lib/jansi-2.4.0.jar:/home/phk/workspace/psgr/tools/marathon-0.7.3/lib/imgscalr-lib-4.2.jar:/home/phk/workspace/psgr/tools/marathon-0.7.3/lib/android-testrunner-contract-0.4.5.jar:/home/phk/workspace/psgr/tools/marathon-0.7.3/lib/google-analytics-java-2.0.0.jar:/home/phk/workspace/psgr/tools/marathon-0.7.3/lib/kotlin-stdlib-jdk7-1.5.21.jar:/home/phk/workspace/psgr/tools/marathon-0.7.3/lib/xenocom-0.0.7.jar:/home/phk/workspace/psgr/tools/marathon-0.7.3/lib/allure-kotlin-model-2.4.0.jar:/home/phk/workspace/psgr/tools/marathon-0.7.3/lib/converter-moshi-2.9.0.jar:/home/phk/workspace/psgr/tools/marathon-0.7.3/lib/converter-scalars-2.9.0.jar:/home/phk/workspace/psgr/tools/marathon-0.7.3/lib/retrofit-2.9.0.jar:/home/phk/workspace/psgr/tools/marathon-0.7.3/lib/okhttp-4.9.1.jar:/home/phk/workspace/psgr/tools/marathon-0.7.3/lib/kotlinx-serialization-json-jvm-1.2.1.jar:/home/phk/workspace/psgr/tools/marathon-0.7.3/lib/okhttp-2.7.4.jar:/home/phk/workspace/psgr/tools/marathon-0.7.3/lib/okio-jvm-2.8.0.jar:/home/phk/workspace/psgr/tools/marathon-0.7.3/lib/kotlinx-serialization-core-jvm-1.2.1.jar:/home/phk/workspace/psgr/tools/marathon-0.7.3/lib/kotlin-stdlib-1.5.21.jar:/home/phk/workspace/psgr/tools/marathon-0.7.3/lib/logback-core-1.2.11.jar:/home/phk/workspace/psgr/tools/marathon-0.7.3/lib/asn-one-0.6.0.jar:/home/phk/workspace/psgr/tools/marathon-0.7.3/lib/jcl-over-slf4j-1.7.25.jar:/home/phk/workspace/psgr/tools/marathon-0.7.3/lib/slf4j-api-1.7.32.jar:/home/phk/workspace/psgr/tools/marathon-0.7.3/lib/commons-text-1.9.jar:/home/phk/workspace/psgr/tools/marathon-0.7.3/lib/allure-model-2.18.1.jar:/home/phk/workspace/psgr/tools/marathon-0.7.3/lib/testng-6.14.3.jar:/home/phk/workspace/psgr/tools/marathon-0.7.3/lib/msgpack-core-0.9.0.jar:/home/phk/workspace/psgr/tools/marathon-0.7.3/lib/rxjava-2.2.19.jar:/home/phk/workspace/psgr/tools/marathon-0.7.3/lib/swagger-annotations-1.6.1.jar:/home/phk/workspace/psgr/tools/marathon-0.7.3/lib/influxdb-client-utils-3.4.0.jar:/home/phk/workspace/psgr/tools/marathon-0.7.3/lib/jsr305-3.0.2.jar:/home/phk/workspace/psgr/tools/marathon-0.7.3/lib/failureaccess-1.0.1.jar:/home/phk/workspace/psgr/tools/marathon-0.7.3/lib/listenablefuture-9999.0-empty-to-avoid-conflict-with-guava.jar:/home/phk/workspace/psgr/tools/marathon-0.7.3/lib/checker-qual-3.12.0.jar:/home/phk/workspace/psgr/tools/marathon-0.7.3/lib/error_prone_annotations-2.11.0.jar:/home/phk/workspace/psgr/tools/marathon-0.7.3/lib/j2objc-annotations-1.3.jar:/home/phk/workspace/psgr/tools/marathon-0.7.3/lib/bcpkix-jdk15on-1.70.jar:/home/phk/workspace/psgr/tools/marathon-0.7.3/lib/bcutil-jdk15on-1.70.jar:/home/phk/workspace/psgr/tools/marathon-0.7.3/lib/bcprov-jdk15on-1.70.jar:/home/phk/workspace/psgr/tools/marathon-0.7.3/lib/jzlib-1.1.3.jar:/home/phk/workspace/psgr/tools/marathon-0.7.3/lib/eddsa-0.3.0.jar:/home/phk/workspace/psgr/tools/marathon-0.7.3/lib/snakeyaml-1.28.jar:/home/phk/workspace/psgr/tools/marathon-0.7.3/lib/commons-lang3-3.11.jar:/home/phk/workspace/psgr/tools/marathon-0.7.3/lib/annotations-30.0.3.jar:/home/phk/workspace/psgr/tools/marathon-0.7.3/lib/kxml2-2.3.0.jar:/home/phk/workspace/psgr/tools/marathon-0.7.3/lib/protobuf-java-3.10.0.jar:/home/phk/workspace/psgr/tools/marathon-0.7.3/lib/annotations-23.0.0.jar:/home/phk/workspace/psgr/tools/marathon-0.7.3/lib/javax.annotation-api-1.3.2.jar:/home/phk/workspace/psgr/tools/marathon-0.7.3/lib/commons-pool2-2.11.1.jar:/home/phk/workspace/psgr/tools/marathon-0.7.3/lib/protobuf-javalite-3.19.4.jar:/home/phk/workspace/psgr/tools/marathon-0.7.3/lib/httpclient-4.5.3.jar:/home/phk/workspace/psgr/tools/marathon-0.7.3/lib/kotlin-stdlib-common-1.5.21.jar:/home/phk/workspace/psgr/tools/marathon-0.7.3/lib/jcommander-1.72.jar:/home/phk/workspace/psgr/tools/marathon-0.7.3/lib/bsh-2.0b6.jar:/home/phk/workspace/psgr/tools/marathon-0.7.3/lib/moshi-1.8.0.jar:/home/phk/workspace/psgr/tools/marathon-0.7.3/lib/commons-csv-1.8.jar:/home/phk/workspace/psgr/tools/marathon-0.7.3/lib/reactive-streams-1.0.3.jar:/home/phk/workspace/psgr/tools/marathon-0.7.3/lib/commons-lang-2.6.jar:/home/phk/workspace/psgr/tools/marathon-0.7.3/lib/argparse4j-0.9.0.jar:/home/phk/workspace/psgr/tools/marathon-0.7.3/lib/processoutput4j-0.0.11.jar:/home/phk/workspace/psgr/tools/marathon-0.7.3/lib/netty-handler-proxy-4.1.73.Final.jar:/home/phk/workspace/psgr/tools/marathon-0.7.3/lib/netty-codec-http2-4.1.73.Final.jar:/home/phk/workspace/psgr/tools/marathon-0.7.3/lib/netty-codec-http-4.1.73.Final.jar:/home/phk/workspace/psgr/tools/marathon-0.7.3/lib/netty-resolver-dns-4.1.73.Final.jar:/home/phk/workspace/psgr/tools/marathon-0.7.3/lib/netty-handler-4.1.73.Final.jar:/home/phk/workspace/psgr/tools/marathon-0.7.3/lib/netty-codec-socks-4.1.73.Final.jar:/home/phk/workspace/psgr/tools/marathon-0.7.3/lib/netty-codec-dns-4.1.73.Final.jar:/home/phk/workspace/psgr/tools/marathon-0.7.3/lib/netty-codec-4.1.73.Final.jar:/home/phk/workspace/psgr/tools/marathon-0.7.3/lib/netty-transport-4.1.73.Final.jar:/home/phk/workspace/psgr/tools/marathon-0.7.3/lib/netty-buffer-4.1.73.Final.jar:/home/phk/workspace/psgr/tools/marathon-0.7.3/lib/netty-resolver-4.1.73.Final.jar:/home/phk/workspace/psgr/tools/marathon-0.7.3/lib/netty-common-4.1.73.Final.jar:/home/phk/workspace/psgr/tools/marathon-0.7.3/lib/perfmark-api-0.23.0.jar:/home/phk/workspace/psgr/tools/marathon-0.7.3/lib/httpcore-4.4.6.jar:/home/phk/workspace/psgr/tools/marathon-0.7.3/lib/commons-codec-1.9.jar:/home/phk/workspace/psgr/tools/marathon-0.7.3/lib/netty-tcnative-classes-2.0.46.Final.jar:/home/phk/workspace/psgr/tools/marathon-0.7.3/lib/grpc-context-1.44.0.jar:/home/phk/workspace/psgr/tools/marathon-0.7.3/lib/annotations-4.1.1.4.jar:/home/phk/workspace/psgr/tools/marathon-0.7.3/lib/animal-sniffer-annotations-1.19.jar
I 10:36:52.131 [main @coroutine#1] <com.malinskiy.marathon.Marathon> java.vm.vendor: Amazon.com Inc.
I 10:36:52.131 [main @coroutine#1] <com.malinskiy.marathon.Marathon> os.version: 5.8.0-48-generic
I 10:36:52.131 [main @coroutine#1] <com.malinskiy.marathon.Marathon> java.runtime.name: OpenJDK Runtime Environment
I 10:36:52.131 [main @coroutine#1] <com.malinskiy.marathon.Marathon> java.vendor.url: https://aws.amazon.com/corretto/
I 10:36:52.132 [main @coroutine#1] <com.malinskiy.marathon.Marathon> java.vm.name: OpenJDK 64-Bit Server VM
I 10:36:52.132 [main @coroutine#1] <com.malinskiy.marathon.Marathon> java.vm.specification.version: 15
I 10:36:52.132 [main @coroutine#1] <com.malinskiy.marathon.Marathon> os.name: Linux
I 10:36:52.132 [main @coroutine#1] <com.malinskiy.marathon.Marathon> java.vendor.version: Corretto-15.0.2.7.1
I 10:36:52.132 [main @coroutine#1] <com.malinskiy.marathon.Marathon> java.vendor.url.bug: https://github.com/corretto/corretto-jdk/issues/
I 10:36:52.132 [main @coroutine#1] <com.malinskiy.marathon.Marathon> java.io.tmpdir: /tmp
I 10:36:52.132 [main @coroutine#1] <com.malinskiy.marathon.Marathon> java.version: 15.0.2
I 10:36:52.132 [main @coroutine#1] <com.malinskiy.marathon.Marathon> os.arch: amd64
I 10:36:52.132 [main @coroutine#1] <com.malinskiy.marathon.Marathon> java.specification.vendor: Oracle Corporation
I 10:36:52.132 [main @coroutine#1] <com.malinskiy.marathon.Marathon> java.vm.specification.name: Java Virtual Machine Specification
I 10:36:52.132 [main @coroutine#1] <com.malinskiy.marathon.Marathon> java.version.date: 2021-01-19
I 10:36:52.132 [main @coroutine#1] <com.malinskiy.marathon.Marathon> java.home: /usr/lib/jvm/java-15-amazon-corretto
I 10:36:52.132 [main @coroutine#1] <com.malinskiy.marathon.Marathon> java.vm.compressedOopsMode: 32-bit
I 10:36:52.132 [main @coroutine#1] <com.malinskiy.marathon.Marathon> java.library.path: /usr/java/packages/lib:/usr/lib64:/lib64:/lib:/usr/lib
I 10:36:52.132 [main @coroutine#1] <com.malinskiy.marathon.Marathon> java.vm.info: mixed mode, sharing
I 10:36:52.132 [main @coroutine#1] <com.malinskiy.marathon.Marathon> java.vm.specification.vendor: Oracle Corporation
I 10:36:52.132 [main @coroutine#1] <com.malinskiy.marathon.Marathon> java.specification.name: Java Platform API Specification
I 10:36:52.132 [main @coroutine#1] <com.malinskiy.marathon.Marathon> java.vendor: Amazon.com Inc.
I 10:36:52.132 [main @coroutine#1] <com.malinskiy.marathon.Marathon> java.vm.version: 15.0.2+7
I 10:36:52.132 [main @coroutine#1] <com.malinskiy.marathon.Marathon> java.class.version: 59.0
* daemon not running; starting now at tcp:5037
* daemon started successfully
D 10:36:52.735 [main @coroutine#1] <AdamDeviceProvider> Android Debug Bridge /127.0.0.1:5037: version 41
D 10:36:52.796 [DeviceMonitor @coroutine#7] <AdamDeviceProvider> Device 0051948259 changed state to CONNECTED
D 10:36:52.797 [DeviceMonitor @coroutine#7] <AdamDeviceProvider> Device emulator-5554 changed state to CONNECTED
D 10:36:52.872 [AndroidDevice - execution - 127.0.0.1:5037:emulator-5554-2 @coroutine#14] <AndroidDevice> Device 127.0.0.1:5037:emulator-5554 booted!
D 10:36:52.936 [AndroidDevice - execution - 127.0.0.1:5037:0051948259-2 @coroutine#13] <AndroidDevice> Device 127.0.0.1:5037:0051948259 booted!
I 10:36:52.966 [main @coroutine#1] <com.malinskiy.marathon.Marathon> Scheduling 1 tests
D 10:36:52.967 [main @coroutine#1] <com.malinskiy.marathon.Marathon> br.com.phk.helloworld.MainActivityTest#textViewIsDisplayed
I 10:36:52.969 [main @coroutine#1] <com.malinskiy.marathon.Marathon> Output /home/phk/workspace/psgr/exp/spn/programs/helloworld/build/reports/marathon already exists
D 10:36:53.072 [main @coroutine#25] <Scheduler> device 127.0.0.1:5037:emulator-5554 associated with poolId omni
D 10:36:53.073 [main @coroutine#25] <Scheduler> pool actor omni is being created
D 10:36:53.085 [main @coroutine#38] <DevicePoolActor[omni]> add device 127.0.0.1:5037:emulator-5554
D 10:36:53.092 [main @coroutine#41] <D.0.0.1:5037:emulator-5554]> initialize 127.0.0.1:5037:emulator-5554
D 10:36:53.109 [AndroidDevice - execution - 127.0.0.1:5037:emulator-5554-2 @coroutine#43] <AndroidAppInstaller> Installing application output to 127.0.0.1:5037:emulator-5554
I 10:36:53.149 [AndroidDevice - execution - 127.0.0.1:5037:emulator-5554-1 @coroutine#43] <AndroidAppInstaller> Uninstalling br.com.phk.helloworld from 127.0.0.1:5037:emulator-5554
D 10:36:53.286 [AndroidDevice - execution - 127.0.0.1:5037:emulator-5554-1 @coroutine#43] <AndroidAppInstaller> Success
I 10:36:53.286 [AndroidDevice - execution - 127.0.0.1:5037:emulator-5554-1 @coroutine#43] <AndroidAppInstaller> Installing br.com.phk.helloworld, /home/phk/workspace/psgr/exp/spn/programs/helloworld/app/build/outputs/apk/debug/app-debug.apk to 127.0.0.1:5037:emulator-5554
D 10:36:53.347 [AndroidDevice - execution - 127.0.0.1:5037:emulator-5554-2 @coroutine#43] <AndroidDevice> Transferred app-debug.apk to/from 127.0.0.1:5037:emulator-5554. 64067,80 KB/s (3780530 bytes in 0,0590)
D 10:36:53.410 [main @coroutine#25] <Scheduler> device 127.0.0.1:5037:0051948259 associated with poolId omni
D 10:36:53.410 [main @coroutine#38] <DevicePoolActor[omni]> add device 127.0.0.1:5037:0051948259
D 10:36:53.411 [main @coroutine#70] <D.0.0.1:5037:0051948259]> initialize 127.0.0.1:5037:0051948259
D 10:36:53.412 [AndroidDevice - execution - 127.0.0.1:5037:0051948259-2 @coroutine#72] <AndroidAppInstaller> Installing application output to 127.0.0.1:5037:0051948259
D 10:36:53.469 [AndroidDevice - execution - 127.0.0.1:5037:emulator-5554-2 @coroutine#43] <AndroidDevice> /data/local/tmp/app-debug.apk synced in 95ms
I 10:36:53.576 [AndroidDevice - execution - 127.0.0.1:5037:0051948259-1 @coroutine#72] <AndroidAppInstaller> Uninstalling br.com.phk.helloworld from 127.0.0.1:5037:0051948259
D 10:36:53.625 [AndroidDevice - execution - 127.0.0.1:5037:emulator-5554-2 @coroutine#43] <AndroidAppInstaller> Success
D 10:36:53.625 [AndroidDevice - execution - 127.0.0.1:5037:emulator-5554-2 @coroutine#43] <AndroidAppInstaller> Installing instrumentation package to 127.0.0.1:5037:emulator-5554
I 10:36:53.683 [AndroidDevice - execution - 127.0.0.1:5037:emulator-5554-2 @coroutine#43] <AndroidAppInstaller> Uninstalling br.com.phk.helloworld.test from 127.0.0.1:5037:emulator-5554
D 10:36:53.853 [AndroidDevice - execution - 127.0.0.1:5037:emulator-5554-2 @coroutine#43] <AndroidAppInstaller> Success
I 10:36:53.853 [AndroidDevice - execution - 127.0.0.1:5037:emulator-5554-2 @coroutine#43] <AndroidAppInstaller> Installing br.com.phk.helloworld.test, /home/phk/workspace/psgr/exp/spn/programs/helloworld/app/build/outputs/apk/androidTest/debug/app-debug-androidTest.apk to 127.0.0.1:5037:emulator-5554
D 10:36:53.881 [AndroidDevice - execution - 127.0.0.1:5037:emulator-5554-1 @coroutine#43] <AndroidDevice> Transferred app-debug-androidTest.apk to/from 127.0.0.1:5037:emulator-5554. 20851,85 KB/s (563559 bytes in 0,0270)
D 10:36:53.950 [AndroidDevice - execution - 127.0.0.1:5037:emulator-5554-2 @coroutine#43] <AndroidDevice> /data/local/tmp/app-debug-androidTest.apk synced in 67ms
D 10:36:54.068 [AndroidDevice - execution - 127.0.0.1:5037:emulator-5554-1 @coroutine#43] <AndroidAppInstaller> Success
D 10:36:54.069 [AndroidDevice - execution - 127.0.0.1:5037:emulator-5554-1 @coroutine#43] <AndroidAppInstaller> Prepare installation finished for 127.0.0.1:5037:emulator-5554
D 10:36:54.185 [main @coroutine#39] <QueueActor[DevicePoolId(name=omni)]> request next batch for device 127.0.0.1:5037:emulator-5554
D 10:36:54.185 [main @coroutine#39] <QueueActor[DevicePoolId(name=omni)]> sending next batch for device 127.0.0.1:5037:emulator-5554
D 10:36:54.187 [main @coroutine#41] <D.0.0.1:5037:emulator-5554]> executeBatch 127.0.0.1:5037:emulator-5554
D 10:36:54.199 [AndroidDevice - execution - 127.0.0.1:5037:emulator-5554-2 @coroutine#105] <AndroidDeviceTestRunner> tests = [br.com.phk.helloworld.MainActivityTest#textViewIsDisplayed]
D 10:36:54.202 [AndroidDevice - execution - 127.0.0.1:5037:emulator-5554-2 @coroutine#105] <AndroidDeviceTestRunner> Running 00B6shell:am instrument -w -r --no-window-animation -e class br.com.phk.helloworld.MainActivityTest#textViewIsDisplayed br.com.phk.helloworld.test/androidx.test.runner.AndroidJUnitRunner
D 10:36:54.463 [AndroidDevice - execution - 127.0.0.1:5037:0051948259-1 @coroutine#72] <AndroidAppInstaller> Success
I 10:36:54.463 [AndroidDevice - execution - 127.0.0.1:5037:0051948259-1 @coroutine#72] <AndroidAppInstaller> Installing br.com.phk.helloworld, /home/phk/workspace/psgr/exp/spn/programs/helloworld/app/build/outputs/apk/debug/app-debug.apk to 127.0.0.1:5037:0051948259
I 10:36:54.598 [AndroidDevice - execution - 127.0.0.1:5037:emulator-5554-2 @coroutine#105] <DebugTestRunListener> testRunStarted 127.0.0.1:5037:emulator-5554
I 10:36:54.600 [AndroidDevice - execution - 127.0.0.1:5037:emulator-5554-2 @coroutine#105] <DebugTestRunListener> testStarted 127.0.0.1:5037:emulator-5554 test = TestIdentifier(className=br.com.phk.helloworld.MainActivityTest, testName=textViewIsDisplayed)
00% | [omni]-[127.0.0.1:5037:emulator-5554] br.com.phk.helloworld.MainActivityTest#textViewIsDisplayed started
D 10:36:54.637 [AndroidDevice - execution - 127.0.0.1:5037:0051948259-1 @coroutine#72] <AndroidDevice> Transferred app-debug.apk to/from 127.0.0.1:5037:0051948259. 21724,14 KB/s (3780530 bytes in 0,1740)
D 10:36:54.801 [AndroidDevice - execution - 127.0.0.1:5037:0051948259-2 @coroutine#72] <AndroidDevice> /data/local/tmp/app-debug.apk synced in 153ms
D 10:36:55.895 [AndroidDevice - execution - 127.0.0.1:5037:emulator-5554-1 @coroutine#114] <AndroidDevice> screenrecord output:
 ShellCommandResult(output=, exitCode=0)
D 10:36:55.896 [AndroidDevice - execution - 127.0.0.1:5037:emulator-5554-1 @coroutine#114] <ScreenRecorder> Recording finished in 1296ms /sdcard/br.com.phk.helloworld.MainActivityTest-textViewIsDisplayed-7210f85b-da61-43f4-876d-c43587b3c107.mp4
I 10:36:56.254 [AndroidDevice - execution - 127.0.0.1:5037:emulator-5554-1 @coroutine#105] <DebugTestRunListener> testEnded 127.0.0.1:5037:emulator-5554 test = TestIdentifier(className=br.com.phk.helloworld.MainActivityTest, testName=textViewIsDisplayed)
100% | [omni]-[127.0.0.1:5037:emulator-5554] br.com.phk.helloworld.MainActivityTest#textViewIsDisplayed ended
I 10:36:56.256 [AndroidDevice - execution - 127.0.0.1:5037:emulator-5554-1 @coroutine#105] <DebugTestRunListener> testRunEnded elapsedTime 867
D 10:36:56.256 [AndroidDevice - execution - 127.0.0.1:5037:emulator-5554-1 @coroutine#105] <AndroidDeviceTestRunner> Execution finished
D 10:36:56.259 [main @coroutine#39] <QueueActor[DevicePoolId(name=omni)]> handle test results 127.0.0.1:5037:emulator-5554
D 10:36:56.260 [main @coroutine#39] <QueueActor[DevicePoolId(name=omni)]> request next batch for device 127.0.0.1:5037:emulator-5554
E 10:36:56.268 [main @coroutine#71] <D.0.0.1:5037:0051948259]> Error Job was cancelled
kotlinx.coroutines.JobCancellationException: Job was cancelled
    at kotlinx.coroutines.JobSupport.cancel(JobSupport.kt:1578)
    at kotlinx.coroutines.Job$DefaultImpls.cancel$default(Job.kt:189)
    at com.malinskiy.marathon.execution.DevicePoolActor.terminate(DevicePoolActor.kt:132)
    at com.malinskiy.marathon.execution.DevicePoolActor.onQueueTerminated(DevicePoolActor.kt:88)
    at com.malinskiy.marathon.execution.DevicePoolActor.receive(DevicePoolActor.kt:51)
    at com.malinskiy.marathon.execution.DevicePoolActor.receive(DevicePoolActor.kt:26)
    at com.malinskiy.marathon.actor.Actor$delegate$1.invokeSuspend(Actor.kt:31)
    (Coroutine boundary)
    at com.malinskiy.marathon.execution.device.DeviceActor$initialize$2$1.invokeSuspend(DeviceActor.kt:165)
    at com.malinskiy.marathon.execution.RetryKt.withRetry(Retry.kt:11)
    at com.malinskiy.marathon.execution.device.DeviceActor$initialize$2.invokeSuspend(DeviceActor.kt:162)
Caused by: kotlinx.coroutines.JobCancellationException: Job was cancelled
    at kotlinx.coroutines.JobSupport.cancel(JobSupport.kt:1578)
    at kotlinx.coroutines.Job$DefaultImpls.cancel$default(Job.kt:189)
    at com.malinskiy.marathon.execution.DevicePoolActor.terminate(DevicePoolActor.kt:132)
    at com.malinskiy.marathon.execution.DevicePoolActor.onQueueTerminated(DevicePoolActor.kt:88)
    at com.malinskiy.marathon.execution.DevicePoolActor.receive(DevicePoolActor.kt:51)
    at com.malinskiy.marathon.execution.DevicePoolActor.receive(DevicePoolActor.kt:26)
    at com.malinskiy.marathon.actor.Actor$delegate$1.invokeSuspend(Actor.kt:31)
    at kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith(ContinuationImpl.kt:33)
    at kotlinx.coroutines.DispatchedTask.run(DispatchedTask.kt:106)
    at kotlinx.coroutines.EventLoopImplBase.processNextEvent(EventLoop.common.kt:279)
    at kotlinx.coroutines.BlockingCoroutine.joinBlocking(Builders.kt:85)
    at kotlinx.coroutines.BuildersKt__BuildersKt.runBlocking(Builders.kt:59)
    at kotlinx.coroutines.BuildersKt.runBlocking(Unknown Source)
    at kotlinx.coroutines.BuildersKt__BuildersKt.runBlocking$default(Builders.kt:38)
    at kotlinx.coroutines.BuildersKt.runBlocking$default(Unknown Source)
    at com.malinskiy.marathon.Marathon.run(Marathon.kt:52)
    at com.malinskiy.marathon.cli.ApplicationViewKt$main$1.invoke(ApplicationView.kt:62)
    at com.malinskiy.marathon.cli.ApplicationViewKt$main$1.invoke(ApplicationView.kt:29)
    at com.xenomachina.argparser.SystemExitExceptionKt.mainBody(SystemExitException.kt:74)
    at com.xenomachina.argparser.SystemExitExceptionKt.mainBody$default(SystemExitException.kt:72)
    at com.malinskiy.marathon.cli.ApplicationViewKt.main(ApplicationView.kt:27)
D 10:36:56.269 [main @coroutine#71] <D.0.0.1:5037:0051948259]> terminate 127.0.0.1:5037:0051948259
Allure environment data saved.
Marathon run finished:
Device pool omni:
    1 passed, 0 failed, 0 ignored tests
    Flakiness overhead: 0ms
    Raw: 1 passed, 0 failed, 0 ignored, 0 incomplete tests
Total time: 0H 0m 4s

I 10:36:56.514 [main] <c.m.m.e.BugsnagExceptionsReporter> Finish BugSnag
D 10:36:56.514 [main] <com.bugsnag.Bugsnag> Closing connection to Bugsnag
marathon v0.7.3: Test run finished
D 10:36:56.530 [Thread-2] <com.bugsnag.Bugsnag> Closing connection to Bugsnag
Malinskiy commented 2 years ago

I'm not sure how you expect to run a single test on multiple devices:

I 10:36:52.966 [main @coroutine#1] <com.malinskiy.marathon.Marathon> Scheduling 1 tests

The test run finishes successfully though, the device is just terminated due to no tests left to run.

phkuroishi commented 2 years ago

Oh sorry, I got it wrong. I thought the test would execute across each device of the cluster. Is there any option to run this single test on each device?

Again, sorry for the misunderstanding

Malinskiy commented 2 years ago

No worries at all. Yeah, you can achieve this behavior by using one of the https://marathonlabs.github.io/marathon/doc/configuration.html#pooling-strategy Each pool executes all of the tests independently.

phkuroishi commented 2 years ago

Oh, ok. Going to try it! Thanks

tagantroy commented 2 years ago

Looks like this problem was solved