The concept seems fine, but the Timeout rule and @Test(timeout=XXX) are not aware of each other. This means that the effective timeout of any test is which ever is smaller. I don't think that this is a real problem, just that the comments and the name of the member variable defaultTimout is slightly misleading. I also don't know if we have any tests that are intended to run for more than 100s. If so they will always timeout after 100s unless they do not extend the HadoopBase, or we set the default to be higher.
Also, I don't know if there is anything we can do about this or not, but when we use both timeouts, the Timeout rule's backtrace, when it fails is close to useless.
testSleep(org.apache.hadoop.test.TestSomething) Time elapsed: 1091 sec <<< ERROR!
java.lang.Exception: test timed out after 1000 milliseconds
at java.lang.Object.wait(Native Method)
It simply says that the code that "timed out" was a thread waiting for the actual test to finish running This is because there are actually two threads monitoring the test, instead of just one.
I realize that a lot of my complaints are perhaps things that need to just be addressed by the JUnit, I just want us to be fully aware of them as we go into this and document things appropriately, so we know what is happening when issues arise.