-
Notifications
You must be signed in to change notification settings - Fork 318
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Espresso test failed, no feedback to help me figure out why #1893
Comments
Sorry without more info its going to difficult for us to help. Have you tried looking at logcat output to see if there are any errors there? Can you share a sample project + steps to reproduce the problem? |
The logcat output is in the attached ZIP file. Like I said, there are no errors there to signify a failed assertion or anything. Our project is not publicly shared, so I can't share it with you. I can tell you, just for testing purposes, I made a test that does literally nothing and still fails. |
Please tell me if I'm missing something, but I don't see the logcat file.
FWIW, there is some working samples at github.com/android/testing-samples if you need a sample project to start from - either to compare setup or build up a repro case. |
|
Ah thank you. I see this in the log when the test starts:
So the test is running in process ID 23848, and that is the last log line for the TestRunner, so the test never finishes. One of the last log lines I see from process 23848 is:
I could be wrong but this seems to indicate the app process under test is exiting itself. Is it possible there is a System.exit or Process.killProcess call or similar somewhere that is being triggered? I cannot explain why you would still see no output in this case - the test runner should tell you that the process died and clearly it is unacceptable to report no output even in an abnormal circumstance. Are you running the test through Android Studio or gradle? What versions? After installing the apks, do something like |
Sorry for the delayed response.
If there is, it's not one I know about. 🤷 However, I tried running the tests from the CLI and saw this:
I should probably mention, I have three different phones to test with (a Huawei P30 Lite running Android 10, a Samsung Galaxy A32 running Android 13, and a Google Pixel 7 running Android 13), and they're all consistently yielding the same results for everything I try.
I've been running it through Android Studio. I have the latest version (Giraffe) and I'm using AGP version 8.0.0.
Here's a stack trace from running the tests with Gradle, if it helps:
|
Is there a stack trace outputted on either the 'adb shell am instrument -w "com.encircle.test/androidx.test.runner.AndroidJUnitRunner' command or in logcat |
No stack trace from the
I haven't found the fix for this yet, but it might have something to do with my issue. |
My guess is StrictMode violations like this aren't the cause. |
OK, maybe I should put in a qualifier about my test results, because I just discovered something else weird. Let me show you one of the tests that I'm trying to run:
And here's how the result looks in Android Studio. If I change the first It's really weird, because these tests aren't complete duds. I was thinking that that first So, the behaviour of the test might be correct, but that yellow exclamation mark is obscuring all feedback somehow. These functions I'm calling in the test plan come from Barista, in case you're wondering. I don't think Barista is the problem because I'm using it in another project and it works just fine there. |
Update: I managed to fix this. |
This comment was marked as off-topic.
This comment was marked as off-topic.
I used |
Here's a logcat dump from the device. To make it easier to digest, I cut it down to start from after the last log entry that comes directly from the app I'm testing, to end at a log entry that specifically mentions a crash. In other words, it's a recording from the last step of the test while it's running, to the supposed abnormality of its closure. If there's anything that would suggest a fault, it'll probably be in here. |
Description
As far as I know, I'm writing my Espresso tests correctly. However, they fail when I run them, and there's nothing that's telling me why they fail so I can fix them. There's no stack trace, no assertion errors in logs, nothing.
Expected Results
In theory, my test should pass.
Actual Results
The test fails, with no information or indication of why it failed.
Here are my only logs. Good luck finding the cause from them.
connected.zip
AndroidX Test and Android OS Versions
Android 10, Android 13
The text was updated successfully, but these errors were encountered: