Hi ,
I have a guestion about the timeOut parameter inside a @Test
method (
)
timeOut
The maximum number of milliseconds this test should
take.
I saw that when the timeoout expires the test fails throwing a timeout exception and the main thread goes
to the next @Test (that is what I expected)
The problem is that I observed also that a second threard is spawned in parallel, that tries to execute the @Test with the expired timeout,
from the point that the timeout occurred. That really messes the execution of the @Test methods inside a test class.
Is this a bug or for some reason it works as designed?
Regards
Panagiotis
Panagiotis Tsiakos
Siemens Enterprise Communications S.A.
Enterprise Product
Development
15 Andrea Metaxa str., Room 1.14
GR 145 64,
Nea
Kifisia
Athens, Greece
Tel: +30 210 8189609
Fax: +30 210
8189761
mailto: panagiotis.tsiakos@siemens-enterprise.com
PASSED: method2
FAILED: method1
org.testng.internal.thread.ThreadTimeoutException: Method org.testng.internal.TestNGMethod.method1() didn't finish within the time-out 1500
--
You received this message because you are subscribed to the Google Groups "testng-users" group.
To post to this group, send email to testng...@googlegroups.com.
To unsubscribe from this group, send email to testng-users...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/testng-users?hl=en.
[TestNG] [DEBUG] suiteXmlPath: "C:\DOCUME~1\grmssfq0\LOCALS~1\Temp\testng-eclipse--1900961393\testng-customsuite.xml"
[TestNG] Running:
C:\Documents and Settings\grmssfq0\Local Settings\Temp\testng-eclipse--1900961393\testng-customsuite.xml
Method called with a
aMethod with arg a waits for 0
aMethod with arg a waits for 1
aMethod with arg a waits for 2
aMethod with arg a waits for 3
aMethod with arg a waits for 4
Method called with b
aMethod with arg b waits for 0
java.lang.InterruptedException: sleep interrupted
Test2 start
at java.lang.Thread.sleep(Native Method)
at com.testall.A01_test1.aMethod(A01_test1.java:27)
at com.testall.A01_test1.test1(A01_test1.java:10)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at org.testng.internal.MethodInvocationHelper.invokeMethod(MethodInvocationHelper.java:80)
at org.testng.internal.InvokeMethodRunnable.runOne(InvokeMethodRunnable.java:46)
at org.testng.internal.InvokeMethodRunnable.run(InvokeMethodRunnable.java:37)
at java.util.concurrent.Executors$RunnableAdapter.call(Unknown Source)
at java.util.concurrent.FutureTask$Sync.innerRun(Unknown Source)
at java.util.concurrent.FutureTask.run(Unknown Source)
at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(Unknown Source)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
at java.lang.Thread.run(Unknown Source)
aMethod with arg b waits for 1
aMethod with arg b waits for 2
aMethod with arg b waits for 3
aMethod with arg b waits for 4
If you see this then is an ERROR
Test2 finsish
PASSED: test2
FAILED: test1
org.testng.internal.thread.ThreadTimeoutException: Method org.testng.internal.TestNGMethod.test1() didn't finish within the time-out 5000
at java.lang.Throwable.getStackTraceElement(Native Method)
at java.lang.Throwable.getOurStackTrace(Throwable.java:591)
at java.lang.Throwable.printStackTrace(Throwable.java:462)
at java.lang.Throwable.printStackTrace(Throwable.java:451)
at com.testall.A01_test1.aMethod(A01_test1.java:29)
at com.testall.A01_test1.test1(A01_test1.java:10)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at org.testng.internal.MethodInvocationHelper.invokeMethod(MethodInvocationHelper.java:80)
at org.testng.internal.InvokeMethodRunnable.runOne(InvokeMethodRunnable.java:46)
at org.testng.internal.InvokeMethodRunnable.run(InvokeMethodRunnable.java:37)
at java.util.concurrent.Executors$RunnableAdapter.call(Unknown Source)
at java.util.concurrent.FutureTask$Sync.innerRun(Unknown Source)
at java.util.concurrent.FutureTask.run(Unknown Source)
at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(Unknown Source)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
at java.lang.Thread.run(Unknown Source)
===============================================
Default test
Tests run: 2, Failures: 1, Skips: 0
===============================================
===============================================
Default suite
Total tests run: 2, Failures: 1, Skips: 0
===============================================
[TestNG] Time taken by org.testng.reporters.SuiteHTMLReporter@3a9bba: 62 ms
[TestNG] Time taken by org.testng.reporters.EmailableReporter@1ed1b0b: 16 ms
[TestNG] Time taken by org.testng.reporters.XMLReporter@1ae90c: 15 ms
[TestNG] Time taken by org.testng.reporters.JUnitReportReporter@18352d8: 0 ms
[TestNG] Time taken by [TestListenerAdapter] Passed:0 Failed:0 Skipped:0]: 16 ms
--
2012/1/27 Cédric Beust ♔ <ced...@beust.com>
--Cédric
To unsubscribe from this group, send email to testng-users+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/testng-users?hl=en.
--
You received this message because you are subscribed to the Google Groups "testng-users" group.
To post to this group, send email to testng...@googlegroups.com.
To unsubscribe from this group, send email to testng-users+unsubscribe@googlegroups.com.
Hi,
2012/1/27 Cédric Beust ♔ <ced...@beust.com>
--Cédric
To unsubscribe from this group, send email to testng-users...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/testng-users?hl=en.
--
You received this message because you are subscribed to the Google Groups "testng-users" group.
To post to this group, send email to testng...@googlegroups.com.
To unsubscribe from this group, send email to testng-users...@googlegroups.com.