Win a copy of Functional Reactive Programming this week in the Other Languages forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

TestNG threadPoolSize - not appearing to work

 
JD Thompson
Greenhorn
Posts: 9
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 9
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic