testing-samples icon indicating copy to clipboard operation
testing-samples copied to clipboard

Error: Test instrumentation process crashed. But there is no /files/ directory

Open iRYO400 opened this issue 6 years ago • 23 comments

Hi all! I get this error Test instrumentation process crashed. Check my.long.package.activity#checkQuitDialog.txt for details But there is no /files folder in /data/data/androidx.test.orchestrator, only /cache and /cache_code. I run test on the Emulator

Prerequisites:

defaultConfig {
...
        testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
        testInstrumentationRunnerArguments clearPackageData: 'true'
}
...
    testOptions {
        unitTests {
            includeAndroidResources = true
            returnDefaultValues = true
        }
        execution 'ANDROIDX_TEST_ORCHESTRATOR'
    }
...
dependencies {
    androidTestUtil 'androidx.test:orchestrator:1.1.1'
    androidTestImplementation('com.schibsted.spain:barista:2.7.1') {
        exclude group: 'com.android.support'
    }
    // Core library
    testImplementation 'androidx.test:core:1.1.0'
    androidTestImplementation 'androidx.test:core:1.1.0'

    // Assertions
    testImplementation 'androidx.test.ext:truth:1.1.0'
    androidTestImplementation 'androidx.test.ext:truth:1.1.0'

    // JUnit
    testImplementation 'androidx.test.ext:junit:1.1.0'
    androidTestImplementation 'androidx.test.ext:junit:1.1.0'

    // JUnitRunner
    testImplementation 'androidx.test:runner:1.1.1'
    androidTestImplementation 'androidx.test:runner:1.1.1'

    // Test helpers for LiveData
    testImplementation 'android.arch.core:core-testing:2.0.0'
    androidTestImplementation 'android.arch.core:core-testing:2.0.0'

    // UI /test
    androidTestImplementation 'androidx.test.espresso:espresso-core:3.1.1'
    androidTestImplementation 'androidx.test.espresso:espresso-contrib:3.1.1'
    androidTestImplementation 'androidx.test.espresso:espresso-intents:3.1.1'
    implementation 'androidx.test.espresso:espresso-idling-resource:3.1.1'
    implementation 'com.jakewharton.espresso:okhttp3-idling-resource:1.0.0'

    // Robolectric/Mockito
    testImplementation 'org.robolectric:robolectric:4.1'
    testImplementation 'org.mockito:mockito-core:2.23.4'
    androidTestImplementation("org.mockito:mockito-core:2.23.4")
    androidTestImplementation("org.mockito:mockito-android:2.23.4")

    // Rest mock
    testImplementation "com.squareup.retrofit2:retrofit-mock:$retrofitVersion"
    testImplementation 'com.squareup.okhttp3:mockwebserver:3.12.1'
}

Thanks!

iRYO400 avatar Feb 04 '19 05:02 iRYO400

image

iRYO400 avatar Feb 04 '19 05:02 iRYO400

I have the same issue, getting what seems to be somewhat random crashes in various tests when I run the whole androidTest suite. Nothing of value in Logcat nor those files #.txt that are mentioned in the output. Have you had any progress on this?

tsaulic avatar Mar 20 '19 00:03 tsaulic

anyone have a solution?

RKuanysh avatar Mar 26 '19 04:03 RKuanysh

Same issue, random crashes in various tests when running the whole androidTest suite. Nothing of value in Logcat, no files #.txt that are mentioned in the messages. Anyone got any ideas on this?

sarah-j-smith avatar Apr 01 '19 07:04 sarah-j-smith

@sarah-j-smith still no

iRYO400 avatar Apr 01 '19 10:04 iRYO400

I just had a similar problem and found the log files by using adb shell as emulator root. This meant I had to use a non-play api image. Once root within an adb shell I found the files at ls /data/data/androidx.test.orchestrator/files. As non-root the files directory was inaccessible, Permission denied. For what it was worth I later obtained similar information about the cause of the test failure by running the test with the debugger.

jasco avatar Apr 01 '19 21:04 jasco

Same problem here, would like to have better access to those .txt files

menjoo avatar Apr 16 '19 07:04 menjoo

I've noticed that sometimes the files are generated, but they're not very helpful:

INSTRUMENTATION_RESULT: stream=
NSTRUMENTATION_RESULT: stream=
INSTRUMENTATION_CODE: -1
tream=

@ /data/user_de/0/androidx.test.orchestrator/files/<your.test.class>#<your.test.name>.txt

note: stripped a bunch of ����

tsaulic avatar May 13 '19 01:05 tsaulic

+1

josinaldobarbosa avatar Jun 01 '19 00:06 josinaldobarbosa

+1

nesterchung avatar Jun 05 '19 07:06 nesterchung

Ho to solves this issue? Does anyone have a solution?

+1

herbert-soares-ifood avatar Jun 25 '19 17:06 herbert-soares-ifood

On adroid 9+ i have this problem.

herbert-soares-ifood avatar Jun 25 '19 17:06 herbert-soares-ifood

Sorry to say, but I have android 7.1.1 on emulator and this issue is still reproducible.

Does any update hear? If someone has a solution please replay.

They seem to be found in /data/user_de/0/androidx.test.orchestrator/files on my emulator (Android 10) but again as @tsaulic noted the actual files don't tell you anything either.

TheBrokenRail avatar Oct 11 '19 23:10 TheBrokenRail

@raviranjanchaudhari-tudip as mentioned above, for me the functional solution, when it can be reproduced, has been to use the debugger and trap on exceptions.

jasco avatar Oct 12 '19 19:10 jasco

Emulator Android 4.4 works for me android44

poorpeschino avatar Nov 20 '19 08:11 poorpeschino

If anyone is still struggling with this, commenting out:

// execution 'ANDROIDX_TEST_ORCHESTRATOR'

In the testOptions of the project build.gradle enabled me to see more informative error messages from these tests.

niall8z avatar Apr 08 '20 09:04 niall8z

If anyone is still struggling with this, commenting out:

// execution 'ANDROIDX_TEST_ORCHESTRATOR'

In the testOptions of the project build.gradle enabled me to see more informative error messages from these tests.

@niall8z I just received this error two days after you leave this comment, I am so lucky. You and I are linked! Commenting it out helped give me detailed errors.

HeinousGames avatar Apr 11 '20 18:04 HeinousGames

This also worked for me. Thanks @niall8z!

irplonk avatar May 14 '20 18:05 irplonk

If anyone is still struggling with this, commenting out:

// execution 'ANDROIDX_TEST_ORCHESTRATOR'

In the testOptions of the project build.gradle enabled me to see more informative error messages from these tests.

Did not work for me.

therealbluepandabear avatar Apr 30 '22 04:04 therealbluepandabear