Comments (5)
Edited the ticket to improve readability.
from dexmaker.
Maybe related: https://stackoverflow.com/questions/59037486/cannot-debug-android-instrumentedtest-activityscenario-koin-mocck
from dexmaker.
Hi @smccants! Sorry for the delay here - I've been trying to repro this with your gradle setup, as well as the sample test linked in that SO post, but have not been able to repro the crash. Could you share some sample test code that causes the crash? I think especially important is understanding what you're trying to mock that causes it - I've tried mocking a bunch of final methods from various OS classes, and haven't had any problems with or without the debugger. A sample project would be awesome if you have the time. Thanks!!
from dexmaker.
@kkoser thanks for looking at this ticket. I spent about half a day trying to build a simple test case that would fail, but so far no luck. More interesting, as I pared down the existing test case, it didn't even require anything being mocked to crash. Also, the crash seems to occur at different places and occasionally not at all. It does seem to be time sensitive - I removed almost all of what I was testing (switching between activities by click) and the test would pass consistently. I added a sleep back in and the crash resumed. Best I can tell so far, it looks like a combination of some memory corruption with a race condition. I'm still working on a simple test case, but thought I'd update you on what I found so far.
from dexmaker.
Thanks, that's useful! If it's a memory leak then it makes sense it would be time-related; theres probably some hidden limit that we hit after a certain amount of time depending on what's happening on the device. As for it requiring no mocking, that's really interesting - I'll try and see if anything stands out as dangerous in init code, although this bug may also be in the JVMTI implementation itself if that's the case...
from dexmaker.
Related Issues (20)
- [Android] error with org.mockito:mockito-core:3.2.4 HOT 1
- Received status code 501 from server: HTTPS Required HOT 2
- Allow mocking of native methods HOT 1
- How to generate a class with generics type? HOT 4
- Could not init mockmaker InlineStaticMockMaker neither InlineDexmakerMockMaker HOT 8
- Does not introduce transitive dependency of mockito per README HOT 2
- mockStatic PendingIntent got NPE HOT 1
- Mock fail when use dexmaker-mockito-inline instead of dexmaker-mockito HOT 1
- Migrate away from JCenter HOT 6
- dexmaker crash HOT 2
- dexmaker gson crash HOT 1
- dexmaker under AOSP HOT 2
- Why Code#compare parameter order is reversed after generated dex? HOT 2
- Failed to load interface org.mockito.plugins.MockMaker implementation declared in sun.misc.CompoundEnumeratio HOT 5
- [Help] How get self method and Object HOT 12
- Random FileNotFoundException when mocking Android class HOT 5
- Gain
- java.lang.SecurityException: Writable dex file error when executing on Android 14 HOT 1
- UI test cases failing on API 34 HOT 5
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from dexmaker.