title: TestNG parallel Execution with DataProvider
body: <p>I have a single test which receives data from data provider. I would like this test to run in parallel with different values from data provider .</p>
  
  <p>I tried an approach like :</p>
  
  <pre><code>public class IndependentTest
  {
  @Test(dataProvider = "dp1" ,threadPoolSize=3,invocationCount=1)
  
  public void testMethod(int number)
  {
      Long id = Thread.currentThread().getId();
      System.out.println("HELLO :  " + id);
  }
  
  
  @DataProvider(name = "dp1",parallel=true)
  public Object[][] dp1() {
    return new Object[][] {
        new Object[] { 1 },
        new Object[] { 2 },
        new Object[] { 3 },
        new Object[] { 4 },
        new Object[] { 5 },
        new Object[] { 6 },
        new Object[] { 7 },
        new Object[] { 8 }
  
    };
  }
  </code></pre>
  
  <p>}</p>
  
  <p>The output i received is :</p>
  
  <p>HELLO :  10</p>
  
  <p>HELLO :  12</p>
  
  <p>HELLO :  17</p>
  
  <p>HELLO :  11</p>
  
  <p>HELLO :  16</p>
  
  <p>HELLO :  14</p>
  
  <p>HELLO :  13</p>
  
  <p>HELLO :  15</p>
  
  <p>Spawned 10 threads while i specified 5 in the thread pool size . 
  Could you please tell what has to be added to the above snippet to control the data provider thread pool size . </p>