-
Notifications
You must be signed in to change notification settings - Fork 72
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
ExpectedSystemExit doesn't work in multi-threading environment #44
Comments
@stefanbirkner FYI: I've implemented needed functionality in my code using your |
Could you provide a pull request that fixes the issue? That would be very helpful. |
@stefanbirkner thank you for interest. I'll provide PR. |
@stefanbirkner pls, review provided PR with the fix |
Thanks for the pull request. I cannot review it the next two weeks, but I review it afterwards. |
@stefanbirkner NP. let me know if you will have some notes, remarks etc. |
In integration testing if a test is executed on the one thread but
System.exit(...)
is called on anotherExpectedSystemExit
work unstable. If the test is finished faster then another thread callsSystem.exit(...)
then currentExpectedSystemExit
implementation fails the test.The solution is to delay the test thread till
System.exit(...)
is called or time out time is finished. It's possible to usejava.util.concurrent.CountDownLatch
for this but I couldn't find ability to do the latch count down somewhere inNoExitSecurityManager
.P.S. if
ExpectedSystemExit
work as aRule
in multi-threading environment isn't break any JUnit conventions I can prepare pull request for the fix.The text was updated successfully, but these errors were encountered: