Skip to content
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

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -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
Copy link
Member

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 ...."

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, you are correct.

// 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.");
Copy link
Member

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")?

Copy link
Contributor Author

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.

}
}
}
}
}
Expand Down