Instrumented test results outputs nothing when test collection failed(process crashed) with AndroidX test orchestrator
Nobody has claimed this yet.
Assessment
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Newbie friendliness
- 35/100
- Issue type
- Bug
- Clarity
- Mostly clear
- Activity status
- Stale
- Tech stack
- java
- Domain
- mobile-dev, testing
Research direction
Start with the AndroidX test orchestrator instrumentation-result handling and the reported testCollection.txt output; reproduce the Application.onCreate() crash using the documented adb command on API 29. Trace why the recorded crash details are not reflected in the final instrumentation output, and consider the issue done when the process crash is reported as a test failure rather than OK (0 tests).
Written by the indexing model from the issue text.
Description
Description
My code changes caused exception at Application.onCreate(), and instrumented tests run via AndroidX test orchestrator.
execution command line like:
// prepare AndroidX test orchestrator
....
adb shell 'CLASSPATH=$(pm path androidx.test.services) app_process / androidx.test.services.shellexecutor.ShellMain am instrument -w -r -e coverageFilePath coverage_files/ -e useTestStorage true -e coverage true -e clearPackageData true -e targetInstrumentation com.mypackage.test/androidx.test.runner.AndroidJUnitRunner androidx.test.orchestrator/.AndroidTestOrchestrator'
INSTRUMENTATION_RESULT: stream=
Time: 0
OK (0 tests)
INSTRUMENTATION_CODE: 0
And there is one details file at adb shell run-as androidx.test.orchestrator cat /data/user_de/0/androidx.test.orchestrator/files/testCollection.txt.
INSTRUMENTATION_STATUS: stack=java.io.FileNotFoundException: my_data.json
at android.content.res.AssetManager.nativeOpenAsset(Native Method)
at android.content.res.AssetManager.open(AssetManager.java:824)
at android.content.res.AssetManager.open(AssetManager.java:801)
at ...
at com.mypackage.test.ShellApplication.onCreate(ShellApplication.kt:73)
at android.app.Instrumentation.callApplicationOnCreate(Instrumentation.java:1189)
at androidx.test.runner.MonitoringInstrumentation.callApplicationOnCreate(MonitoringInstrumentation.java:483)
at android.app.ActivityThread.handleBindApplication(ActivityThread.java:6460)
at android.app.ActivityThread.access$1300(ActivityThread.java:219)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1859)
at android.os.Handler.dispatchMessage(Handler.java:107)
at android.os.Looper.loop(Looper.java:214)
at android.app.ActivityThread.main(ActivityThread.java:7356)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:492)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:930)
INSTRUMENTATION_STATUS: stream=
Process crashed before executing the test(s):
java.io.FileNotFoundException: my_data.json
at android.content.res.AssetManager.nativeOpenAsset(Native Method)
at android.content.res.AssetManager.open(AssetManager.java:824)
at android.content.res.AssetManager.open(AssetManager.java:801)
at ....
at com.mypackage.test.ShellApplication.onCreate(ShellApplication.kt:73)
at android.app.Instrumentation.callApplicationOnCreate(Instrumentation.java:1189)
at androidx.test.runner.MonitoringInstrumentation.callApplicationOnCreate(MonitoringInstrumentation.java:483)
at android.app.ActivityThread.handleBindApplication(ActivityThread.java:6460)
at android.app.ActivityThread.access$1300(ActivityThread.java:219)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1859)
at android.os.Handler.dispatchMessage(Handler.java:107)
at android.os.Looper.loop(Looper.java:214)
at android.app.ActivityThread.main(ActivityThread.java:7356)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:492)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:930)
INSTRUMENTATION_STATUS_CODE: -2
INSTRUMENTATION_RESULT: shortMsg=Process crashed.
INSTRUMENTATION_CODE: 0
Steps to Reproduce
- raise exception at Application.onCreate().
- run tests using AndroidX test orchestrator.
Expected Results
See process crashed details in instrumented tests results outputs to indicate test failure.
Actual Results
No process crashed details in instrumented tests results outputs and indicate test success.
AndroidX Test and Android OS Versions
Android API Level 29
AndroidX Test Orchestrator 1.4.2
Link to a public git repo demonstrating the problem:
None currently.
- Dominant language
- Java
- Stars
- 1.2k
- Forks
- 342
- Avg merge
- 1d 14h
- Merged PRs (30d)
- 5
Getting set up
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from android/android-test
-
Difficulty 1/5 Under an hour Newbie friendliness 62/100
android/android-test#681 · 2 comments · 1 reaction ·
-
Difficulty 3/5 1-2 days Newbie friendliness 72/100
android/android-test#2507 · 1 comment ·
-
ξεκσνδξδOpen
Difficulty 5/5 Over a week Newbie friendliness 1/100
android/android-test#2499 ·
-
ησξξσOpen
Difficulty 5/5 Over a week Newbie friendliness 1/100
android/android-test#2498 ·
-
Difficulty 4/5 3-5 days Newbie friendliness 38/100
android/android-test#2473 ·
All issues in android/android-test
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
refinedmods/refinedstorage2#1414 · 1 comment ·
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
-
In Java's `LongBoundedSum`, setting `lower` to `Long.MIN_VALUE` under-estimates the sensitivityOpen
Difficulty 2/5 1-3 hours Newbie friendliness 73/100
google/differential-privacy#489 ·
-
Difficulty 1/5 Under an hour Newbie friendliness 78/100
Maintainers usually reply within 1 day
-
link-check link-check:manual
Difficulty 2/5 1-3 hours Newbie friendliness 85/100