-
Notifications
You must be signed in to change notification settings - Fork 305
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
Seemingly random 'process crashed' for the instrumentation runner #352
Comments
Strange. Nothing in the posted stack trace gives me any clue to what might be wrong. Can you post a sample that reproduces this issue? |
I'm trying to set up a minimal project where the same issue would occur consistently. Still no luck, but will post an update here if I succeed. |
Any update about this issue? I m getting |
Not sure if it can be related but by creating Same as topic starter I use mockk(1.9.3) and |
Same here, also mockk 1.9.3 and launchFragment 1.2.0. Running clean before the test seems to solve the issue. |
Thank you @yuriykulikov, mockk 1.9.3 works with 1.2.0-beta02 (as in - the tests run now). Just had to force objenesis version:
But I still get process crashed randomly, unfortunately. |
closing due to lack of info |
Also seeing this. Getting random crashes that we've narrowed down to use of mockk. Tried various combinations of versions but still happening |
We;re seeing this and the last erroring logcat is suggesting an interplay of Jacoco, Garbage Collector (finalizers) and native. It happens after ~10 minutes of successful test executions. Failure rate is about 3-5%, so not possible to repro.
|
Did anyone find a proper fix for this? |
Got exactly the same issue with multiple projects. I'm pretty sure this come from mockk from a way or another. |
I have exactly the same issue and I also believe MockK could be behind it. I have posted the issue on SO: https://stackoverflow.com/questions/63059986/android-ui-tests-with-espresso-mockk-crash-with-sigsegv Looking at OP crash log, I found one common error message:
In my case, this log message is always right before the crash, usually alongside a SIGSEGV. I am using Espresso to write a login + pwd to test a LoginActivity and I use MockK to mock all the Repositories / Services logic in a MVP architecture. |
I reproduced it on my system: https://github.com/NitroG42/CrashDuringTestSample |
Or can this one with some infos be opened again @brettchabot ? EDIT: it does seems like the bug is coming from mockk after all but I wonder if there anything that can be done on the testing/emulator part. |
I agree with @NitroG42 . I have migrated the few UI tests I had written to on a new mobile app project Mockito believing it would be way more stable thanks to its history and active development. At first, it seemed the crashs were completely gone, but at some point they did reappear, still at random with the dreadful message from On the Android TV project we have (which is way more advanced), the handful tests I developped, which required a lot more mocking, tended to crash a lot more (still on the emulator). When migrating to Mockito, I noticed the same issues and restrictions:
So, if I understand correctly, MockK & Mockito uses the same APIs (from Android Test Instrumentation?) to perform mocking in Android UI tests. While Mockito seemed, at first, a lot more stable, the crash eventually did reappear, for the same reasons. Could it be possible neither of them are the culprit? Finally, I noticed that manually rebooting the emulators greatly reduced the random crash. Surely because it resets all the memory allocations, right? @brettchabot could you help? Do you have any idea what could be the real issue? |
Also experiencing the same problem with UI test. my solution is to use the fake class implementation instead of mocking it and the problem is gone 🤔 |
I had exactly the same issue. In my case it was |
What type of cleaning you mean? Clean cache or clean user data? |
I am facing exactly the same issue on a project I am working on. Have you found anything? |
I have not solve the problem yet, but meybe it hass been caused memmory leaks. |
Using an x64 emulator solved the problem for me, as cristan commented here: mockk/mockk#466 (comment) |
My project uses mockk, and using an x86_64 emulator (API 28+) also solved the problem for me, too mockk/mockk#466 (comment) |
Follow up: I also tried removing mockk as an android test dependency and removed all tests that used it. Once I did that, I found that I could once again run UI tests on non 64 bit emulators When I do run my tests on a non x86_64 bit emulator using mockk version 1.10.3-jdk8, I notice this log in logcat:
|
Using an x86_64 emulator also solved the issue for me. |
Did you ever figure out what was causing this / find a workaround? I'm seeing the same exception when running instrumented tests on physical devices. |
@ricard-v one year later, any update on this? I'm still stuck on this bug, which prevents me from running any UI tests that use mocking in Firebase Test Lab. Wondering if I just need to bite the bullet and removing all mockking libraries if I want my instrumentation tests to run on FTL virtual devices. |
Sorry for the lack of response on this issue. I wish I could help more but TBH I don't have expertise on mocking libraries . This github project probably isn't the right forum to address this issue, as it doesn't seem to be related to the androidx.test libraries. Perhaps the mockk/mockito maintainers or Android ART team could be more help? |
Apologies, I should have commented in the mockk repository. Here's the corresponding issue mockk/mockk#466 |
Since this issue is still open, I'll share my minimal reproducible example: https://github.com/SimonMarquis/FTL-segfault |
Description
What appears to randomly process crashes of the test runner. I understand this may not be the best example on how to present the issue (without the full code), but I was unable to reproduce this on a fresh project :(
Steps to Reproduce
In our app, the test is really simple. When I run it from the IDE it runs almost 100% correctly, from command line via
./gradlew connectedProductionDebugAndroidTest -i
it often fails with the error provided below.
Expected Results
Tests run/pass
Actual Results
Tests pass on average 7/10 times, when they fail, this is logged in Logcat
AndroidX Test and Android OS Versions
Emulator is API 28 Nexus 5, animations turned off.
Link to a public git repo demonstrating the problem:
N/A
The text was updated successfully, but these errors were encountered: