-
-
Notifications
You must be signed in to change notification settings - Fork 338
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
Using Capture Slot fails on every second run of test #523
Comments
How are you handling test repetition? I tried reproducing this with @RepeatedTest(3) on both tests and it passes correctly all three times. |
I've used the build-in feature of InteliJ/AS Goto "Run / Debug Configuration" and select the desired test run of choice or create a new test run. Under Configuration you can set it up to repeat "N Times", "Until Failure" or "Until Success". https://imgur.com/37Ce5p1 Also, please note that in order to reproduce the issue you should run the class tests. Tests pass all the time, if they are run individually for N times. |
Ok thanks, I have been able to reproduce it now. I have been digging a bit in the code and it seems to be happening because when the method call is being intercepted the wrong handler is returned at this line. The reason why this happens, though, is beyond my knowledge of the internals of mockk. Perhaps @oleksiyp knows better. |
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. If you are sure that this issue is important and should not be marked as |
The bug is still reproducible in recent versions. Can we put the important label on it? |
The issue is not related to the mockk library at all. Closing the issue. |
Prerequisites
Please answer the following questions for yourself before submitting an issue.
Expected Behavior
Tests should run with the same result all the time
Current Behavior
First tests always pass, but every second test fails
Steps to Reproduce
The bug appears after running test for more than one time - set repeat count of test for 2 or more.
Context
Stack trace
Minimal reproducible code (the gist of this issue)
The text was updated successfully, but these errors were encountered: