Hello Cedric,
I tested testng-5.14.1beta.zip and it works fine.
The following test:
public class ConfigurationTimeoutTest {
@BeforeClass(timeOut = 2500)
public void beforeClass() throws InterruptedException {
while(true) { }
}
@Test
public void shouldBeSkipped() {
throw(new RuntimeException("should be skipped"));
}
}
gives the following result:
<testng-results>
<reporter-output>
</reporter-output>
<suite name="Gradle suite" duration-ms="2527" started-
at="2010-10-03T20:55:59Z" finished-at="2010-10-03T20:56:02Z">
<groups>
</groups>
<test name="Gradle test" duration-ms="2527" started-
at="2010-10-03T20:55:59Z" finished-at="2010-10-03T20:56:02Z">
<class
name="pl.kaczanowscy.tomek.testng.ConfigurationTimeoutTest">
<test-method status="FAIL" signature="beforeClass()"
name="beforeClass" is-config="true" duration-ms="0" started-
at="2010-10-03T20:55:59Z" finished-at="2010-10-03T20:55:59Z">
<exception
class="org.testng.internal.thread.ThreadTimeoutException">
<message>
<![CDATA[Method
org.testng.internal.ConfigurationMethod.beforeClass() didn't finish
within the time-out 2500]]>
</message>
<full-stacktrace>
<!
[CDATA[org.testng.internal.thread.ThreadTimeoutException: Method
org.testng.internal.ConfigurationMethod.beforeClass() didn't finish
within the time-out 2500
at java.util.concurrent.FutureTask
$Sync.innerSetException(FutureTask.java:273)
at java.util.concurrent.FutureTask
$Sync.innerRun(FutureTask.java:307)
at java.util.concurrent.FutureTask.run(FutureTask.java:138)
at java.util.concurrent.ThreadPoolExecutor
$Worker.runTask(ThreadPoolExecutor.java:886)
at java.util.concurrent.ThreadPoolExecutor
$Worker.run(ThreadPoolExecutor.java:908)
at java.lang.Thread.run(Thread.java:619)
]]>
</full-stacktrace>
</exception>
</test-method>
<test-method status="SKIP" signature="shouldBeSkipped()"
name="shouldBeSkipped" duration-ms="1" started-
at="2010-10-03T20:56:02Z" finished-at="2010-10-03T20:56:02Z">
</test-method>
</class>
</test>
</suite>
</testng-results>
which seems fine for me.
One question thought. @Test uses invocationTimeOut and @BeforeClass
uses timeOut. I would suggest to use the same name for both test and
configuration methods.