-
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -330,7 +330,20 @@ private void forkTest(final TestDefinition test) { | |
break; | ||
} | ||
case Constants.FORK_EXIT_CODE_TIMED_OUT: { | ||
throw new BuildException(new TimeoutException("Forked test(s) timed out")); | ||
// 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 | ||
// of failure, then set the property to true | ||
this.getProject().setNewProperty(test.getFailureProperty(), "true"); | ||
} | ||
} finally { | ||
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 commentThe 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 There was a problem hiding this comment. Choose a reason for hiding this commentThe 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. |
||
} | ||
} | ||
} | ||
} | ||
} | ||
|
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.