android / android-test

An extensive framework for testing Android apps
https://android.github.io/android-test
Apache License 2.0
1.14k stars 306 forks source link

Repeat many times of Espresso Remote test got IllegalStateException #284

Open shifujun opened 5 years ago

shifujun commented 5 years ago

Description

MultiProcessSample in googlesamples/android-testing will crash occasionally.

And if change the private process to main process, repeat 100 times, will success.

Steps to Reproduce

run the ExampleInstrumentedTest in MultiProcessSample 100 times.

Expected Results

Test success.

Actual Results

Testing started at 21:13 ...

03/29 21:13:21: Launching ExampleInstrumentedT...
Running tests

$ adb shell am instrument -w -r   -e debug false -e class 'com.example.android.testing.espresso.multiprocesssample.ExampleInstrumentedTest' com.example.android.testing.espresso.multiprocesssample.test/androidx.test.runner.AndroidJUnitRunner
Client not ready yet..
Started running tests

java.lang.IllegalStateException: Interaction response reported Status.Error, but noerror message was attached to interaction response: androidx.test.espresso.remote.InteractionResponse@8763d4a
at androidx.test.espresso.remote.EspressoRemote.reportResults(EspressoRemote.java:386)
at androidx.test.espresso.remote.EspressoRemote.initiateRemoteCall(EspressoRemote.java:278)
at androidx.test.espresso.remote.EspressoRemote$2.run(EspressoRemote.java:237)
at androidx.test.espresso.remote.EspressoRemote$3.call(EspressoRemote.java:256)
at androidx.test.espresso.remote.EspressoRemote$3.call(EspressoRemote.java:244)
at androidx.test.espresso.core.internal.deps.guava.util.concurrent.TrustedListenableFutureTask$TrustedFutureInterruptibleTask.runInterruptibly(TrustedListenableFutureTask.java:125)
at androidx.test.espresso.core.internal.deps.guava.util.concurrent.InterruptibleTask.run(InterruptibleTask.java:69)
at androidx.test.espresso.core.internal.deps.guava.util.concurrent.TrustedListenableFutureTask.run(TrustedListenableFutureTask.java:78)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1167)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:641)
at java.lang.Thread.run(Thread.java:764)

Tests ran to completion.

AndroidX Test and Android OS Versions

AndroidX Test version as it is in MultiProcessSample of googlesamples/android-testing.

    buildToolsVersion = "28.0.3"
    androidxLibVersion = "1.0.0"
    coreVersion = "1.1.1-alpha02"
    extJUnitVersion = "1.1.1-alpha02"
    runnerVersion = "1.1.2-alpha02"
    rulesVersion = "1.1.2-alpha02"
    espressoVersion = "3.2.0-alpha02"

Android OS Version is 9.0 I use AVD test it.

Name: Pixel_2_XL_API_28

CPU/ABI: Intel Atom (x86_64)

Path: /Users/shifujun/.android/avd/Pixel_2_XL_API_28.avd

Target: default [Default Android System Image] (API level 28)

Skin: pixel_2_xl

SD Card: 512M

fastboot.chosenSnapshotFile: 

runtime.network.speed: full

hw.accelerometer: yes

hw.device.name: pixel_2_xl

hw.lcd.width: 1440

hw.initialOrientation: Portrait

image.androidVersion.api: 28

tag.id: default

hw.mainKeys: no

hw.camera.front: emulated

avd.ini.displayname: Pixel 2 XL API 28

hw.gpu.mode: auto

hw.ramSize: 1536

PlayStore.enabled: false

fastboot.forceColdBoot: no

hw.cpu.ncore: 4

hw.keyboard: yes

hw.sensors.proximity: yes

hw.dPad: no

hw.lcd.height: 2880

vm.heapSize: 384

skin.dynamic: yes

hw.device.manufacturer: Google

hw.gps: yes

hw.audioInput: yes

image.sysdir.1: system-images/android-28/default/x86_64/

showDeviceFrame: yes

hw.camera.back: virtualscene

AvdId: Pixel_2_XL_API_28

hw.lcd.density: 560

hw.arc: false

hw.device.hash2: MD5:ce72d6c2506218ad8c9cc1cfa7e13357

fastboot.forceChosenSnapshotBoot: no

fastboot.forceFastBoot: yes

hw.trackBall: no

hw.battery: yes

hw.sdCard: yes

tag.display: Default Android System Image

runtime.network.latency: none

disk.dataPartition.size: 800M

hw.sensors.orientation: yes

avd.ini.encoding: UTF-8

hw.gpu.enabled: yes

Link to a public git repo demonstrating the problem:

I have commit code of repeat the test 100 times in my repo. https://github.com/shifujun/android-testing/tree/master/ui/espresso/MultiProcessSample

shifujun commented 5 years ago

@brettchabot Could you confirm this problem? Thanks!