[ 
https://issues.apache.org/jira/browse/HADOOP-9330?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13585192#comment-13585192
 ] 

Steve Loughran commented on HADOOP-9330:
----------------------------------------

Discussions with the Maven Surefire team 
(https://issues.apache.org/jira/browse/HADOOP-9112) imply that we can use the 
{{@RunWith}} attribute in a test class to define a custom test runner for it.

This means we can
# Write our own test runner that picks up a default timeout from a system 
property.
# Define a base test class, {{HadoopTestBase}}, that declares its use of this.
# Set the maven build up to propagate a timeout via a system property.
# Have jenkins choose a timeout appropriate to it.

Doing this will obviate the need to place brittle test timeouts in source, and 
be easy to retrofit to existing test classes. 

Assuming all future test cases get built off a new base class (possibly with 
tuned YarnTestBase, HdfsTestBase classes), the base classes would have to go 
back into branch-1 if there was any goal of backporting new tests from trunk. 
Unless Ant can be set up to switch to the new test runner, the {{@RunWith}} 
attribute would have to stripped from the backported test cases.
                
> 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

Reply via email to