Gradle Managed Devices Could Not Receive Test Results From the Test Executor

444 Views Asked by At

Using gradle version 8.0.2

I am using gradle managed devices to run my Android Espresso tests in parallel on 2 emulators. I am running this by using the following command:

./gradlew pixel4api31DebugAndroidTest -Pandroid.testInstrumentationRunnerArguments.class=com.xxx.yyy.zzz.Suites.CITestSuite -Pandroid.experimental.androidTest.numManagedDeviceShards=2 --enable-display -Pandroid.testoptions.manageddevices.emulator.gpu="swiftshader_indirect"

When the tests finish, I am seeing the following error:

Could not receive test results from the test executor.
io.grpc.StatusRuntimeException: CANCELLED: client cancelled
        at io.grpc.Status.asRuntimeException(Status.java:526)
        at io.grpc.stub.ServerCalls$StreamingServerCallHandler$StreamingServerCallListener.onCancel(ServerCalls.java:284)
        at io.grpc.internal.ServerCallImpl$ServerStreamListenerImpl.closedInternal(ServerCallImpl.java:353)
        at io.grpc.internal.ServerCallImpl$ServerStreamListenerImpl.closed(ServerCallImpl.java:341)
        at io.grpc.internal.ServerImpl$JumpToApplicationThreadServerStreamListener$1Closed.runInContext(ServerImpl.java:844)
        at io.grpc.internal.ContextRunnable.run(ContextRunnable.java:37)
        at io.grpc.internal.SerializingExecutor.run(SerializingExecutor.java:123)
        at [email protected]/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128)
        at [email protected]/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628)
        at [email protected]/java.lang.Thread.run(Thread.java:829)

BUILD FAILED in 56m 28s

When i navigate to the result location: Test execution completed. See the report at: file:///Users/xxx/repos/android/test/app/build/reports/androidTests/managedDevice/allDevices/index.html

It shows that all tests passed successfully: enter image description here

Does anyone know how I can fix this error for not being able to see the test results which is making the build fail?

./gradlew -v

------------------------------------------------------------
Gradle 8.0.2
------------------------------------------------------------

Build time:   2023-03-03 16:41:37 UTC
Revision:     7d6581558e226a580d91d399f7dfb9e3095c2b1d

Kotlin:       1.8.10
Groovy:       3.0.13
Ant:          Apache Ant(TM) version 1.10.11 compiled on July 10 2021
JVM:          11.0.18 (Azul Systems, Inc. 11.0.18+10-LTS)
OS:           Mac OS X 13.3.1 aarch64
0

There are 0 best solutions below