aspose file tools*
The moose likes Testing and the fly likes TestNG threadPoolSize - not appearing to work Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of The Java EE 7 Tutorial Volume 1 or Volume 2 this week in the Java EE forum
or jQuery UI in Action in the JavaScript forum!
JavaRanch » Java Forums » Engineering » Testing
Bookmark "TestNG threadPoolSize - not appearing to work" Watch "TestNG threadPoolSize - not appearing to work" New topic
Author

TestNG threadPoolSize - not appearing to work

JD Thompson
Greenhorn

Joined: Jan 03, 2005
Posts: 9
I am testing with TestNG plugin in an Eclipse environment.

I am getting output I did not expect in that I specify a threadPoolSize = 3, i.e @Test(threadPoolSize = 3, invocationCount = 10, timeOut = 100)
but am getting 10 different thread ids when I output from the following simple test:



The output, from an @AfterClass method is:

TestNGInvoker-f() with ID = 13 was used total = 1
TestNGInvoker-f() with ID = 14 was used total = 1
TestNGInvoker-f() with ID = 15 was used total = 1
TestNGInvoker-f() with ID = 16 was used total = 1
TestNGInvoker-f() with ID = 17 was used total = 1
TestNGInvoker-f() with ID = 18 was used total = 1
TestNGInvoker-f() with ID = 19 was used total = 1
TestNGInvoker-f() with ID = 20 was used total = 1
TestNGInvoker-f() with ID = 21 was used total = 1
TestNGInvoker-f() with ID = 22 was used total = 1

What am I missing? Shouldn't I see three different ID's with varying totals?

Thank you in advance for answering my question!!

Take care!

JD
JD Thompson
Greenhorn

Joined: Jan 03, 2005
Posts: 9
Kudos to Mr. Cedric Buest on his prompt reply via another medium. TYVM Cedric!


The answer to the problem was the Test annotation "timeOut" may have a subtle bug, if the timeOut is removed such that @Test(threadPoolSize = 3, invocation = 10) then indeed you will only see three threadIds in the output.

Take care!

JD
 
wood burning stoves
 
subject: TestNG threadPoolSize - not appearing to work