-
Notifications
You must be signed in to change notification settings - Fork 440
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
Handling forked VM timeout in a similar way to junit ant task #197
Conversation
…ttings like haltonfailure have effect
// test has failure(s) | ||
try { | ||
if (test.getFailureProperty() != null) { | ||
// if there are test failures and the test is configured to set a property in case |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Minor nit - I think this comment should say "if a test timed out ...."
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, you are correct.
if (test.isHaltOnFailure()) { | ||
throw new BuildException(new TimeoutException("Forked test(s) timed out")); | ||
} else { | ||
log("Timeout occurred. Please note the time in the report does not reflect the time until the timeout."); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Perhaps remove the report part from this log message and instead just say log("Some test(s) timed out")
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I copied the message as it appears in junit4. I don't have opinion one way or the other.
Thank you Tomasz for this PR. I think this change looks fine. Could you add a test case to verify this change works as expected. We have a junitlauncher test class at |
Thanks for review. I will make changes as you suggested and of course write a test. |
Hello Tomasz, I don't want to rush you, but if writing a test is proving to be time consuming or complicated, do let me know and I'll merge this fix (which looks good to me) and I'll add a test myself. |
Hi, actually I had problems running the tests in the first place. When I build the project the tests do not seem to be executed (build pass even when I introduce failing assertion). I can later today copy exactly which steps I made. |
Some of the tasks in Ant, including the
and then run:
|
Thanks. I will give it a try and let you know. |
@jaikiran I'm sorry but I was unable to run the tests. After implementing your instructions the |
The change in this PR looks fine to me. A test can be added separately - I haven't found the time to try and help you get the test implemented/run. I'll go ahead and merge this now and will add the test later. |
so that settings like haltonfailure have effect. This strives to make junitlauncher task behave similar to junit (4) task.