Closed theHacker closed 2 years ago
@theHacker Can you verify the issue persists on 1.3.5?
Yes, the issue exists also in 1.3.3 and 1.3.5. I even tried latest dev-version 2.0.0.M3. Issue remains.
just want to say that this problem also persist in 2.0.0.RC1
Seems to be some weird issue where the kotlin mocking library is introducing coroutines into the picture which introduces a concurrency issue where the lock is not visible from the couroutine thread. Why a mocking library needs to introduce concurrency and coroutines a Kotlin expert would need to explain.
I had this issue with mockk tests, when mockk was setting stubs in the test body, not during initialisation. Happened only once in few years though. Hope it'll help.
Anyone know of a workaround for this?
Anyone know of a workaround for this?
I stopped changing mock answers in the test body and it helped.
Thanks, @ikovalyov. I ended up switching from mockk to kluent mocks for the affected tests. I was already using kluent for assertions so no new library or wholesale change required.
I'm actually seeing this with junit5 and mockk. Any workarounds?
code under question re-written in 3.x
Task List
Steps to Reproduce
MyServiceTest
inside your IDE to see the full Exception.Expected Behaviour
Test finishes ordinarily.
Actual Behaviour
Micronaut will throw an exception
Environment Information
nm create-app --lang=kotlin
Example Application
Additional information
You can see the problem inside the debugger, when you hold in
MyService
. Evaluate the commented out line, manually resolving the proxy, and it works. But this is in production code, so this cannot be the way.