hadoop-common-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Robert Joseph Evans (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (HADOOP-9330) Add custom JUnit4 test runner with configurable timeout
Date Mon, 25 Mar 2013 19:29:16 GMT

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

Robert Joseph Evans commented on HADOOP-9330:

I agree that there should be something about writing and running tests, but I am not aware
of it either.  I was thinking of just the javadocs for HadoopTestBase, but a dedicated wiki
page or a subsection of HowToContribute would probably be better.  I agree that having timeout=
in the code is brittle, and we probably want to start removing it once this goes in (along
with the changes to test-patch.sh).

But in a follow on JIRA I was thinking we probably could support something similar to what
[~vicaya] proposed.  It should not be that hard to add in our own timeout test runner that
can look for an @Test annotation with a timeout, output a warning about the timeout, and then
allow JUnit to run with that timeout.  We could also provide an @Timeout annotation that would
let us specify a timeout multiplier that is X times the configured base timeout.  That way
we can keep a 100s timeout and adjust it for tests that do take longer.

I am not tied to the idea though, and if it feels like too much work compared simply upping
the default to something like 600s works we could do that instead. 
> 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
>         Attachments: HADOOP-9330-timeouts-1.patch
> 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

View raw message