android / android/android-test

Repeat many times of Espresso Remote test got IllegalStateException

Open
#284 1 comment 0 reactions 0 assignees View on GitHub
Dominant language
Java
Stars
1.2k
Forks
342
Avg merge
11h 29m
Merged PRs (30d)
2

Description

### 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

Contributor guide

Open the contributing guide

Research direction

Start with the MultiProcessSample and run ExampleInstrumentedTest 100 times on the provided API 28 emulator, comparing the private-process and main-process configurations. Trace the failure through the reported EspressoRemote.java calls and use the linked sample repository to reproduce it. Done means the repeated multiprocess test completes successfully without the IllegalStateException.

Written by the indexing model from the issue text.

Assessment

Tech stack
android, java
Domain
mobile-dev, testing
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.