[
https://issues.apache.org/jira/browse/HADOOP-9330?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13585240#comment-13585240
]
Luke Lu commented on HADOOP-9330:
---------------------------------
bq. setting a time out in the runtime can be achievable through
surefire.timeout property, can it not?
surefire.timeout is a test process timeout or per test class if fork mode is
always, not _per_ _test_, which is the rationale for HADOOP-9112 in the first
place.
bq. we can use the @RunWith attribute in a test class to define a custom test
runner for it.
There is no need to use a custom test runner. org.junit.rules.Timeout is what
you want. We can create a common base test class like this.
{code}
public class TestBase {
@Rule public Timeout defaultTimeout = new Timeout(Integer.parseInt(
System.getProperty("test.default.timeout", 100000)));
...
}
{code}
> Add custom JUnit4 test runner with configurable timeout
> -------------------------------------------------------
>
> Key: HADOOP-9330
> URL: https://issues.apache.org/jira/browse/HADOOP-9330
> Project: Hadoop Common
> Issue Type: Test
> Components: test
> Affects Versions: 3.0.0
> Reporter: Steve Loughran
>
> HADOOP-9112 has added a requirement for all new test methods to declare a
> timeout, so that jenkins/maven builds will have better information on a
> timeout.
> Hard coding timeouts into tests is dangerous as it will generate spurious
> failures on slower machines/networks and when debugging a test.
> I propose providing a custom JUnit4 test runner that test cases can declare
> as their test runner; this can provide timeouts specified at run-time, rather
> than in-source.
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira