Confusing Build log in TeamCity in case of parallel tests
<p>I'm using Java, Gradle, TestNG, Selenium Hub and Node on Localhost and trying to run 5 tests in parallel, the following is a sample code.</p>

<p>This is Base class:</p>

<pre><code>package tests.temp;

import java.net.MalformedURLException;
import java.net.URL;

import org.openqa.selenium.WebDriver;
import org.openqa.selenium.firefox.FirefoxDriver;
import org.openqa.selenium.firefox.FirefoxProfile;
import org.openqa.selenium.remote.DesiredCapabilities;
import org.openqa.selenium.remote.RemoteWebDriver;
import org.testng.annotations.AfterMethod;
import org.testng.annotations.BeforeMethod;

public class TestBase
{

protected ThreadLocal&lt;RemoteWebDriver&gt; threadDriver = null;

@BeforeMethod
public void setUp() throws MalformedURLException {

    threadDriver = new ThreadLocal&lt;RemoteWebDriver&gt;();
    DesiredCapabilities dc = new DesiredCapabilities();
    FirefoxProfile fp = new FirefoxProfile();
    dc.setCapability(FirefoxDriver.PROFILE, fp);
    dc.setBrowserName(DesiredCapabilities.firefox().getBrowserName());
    threadDriver.set(new RemoteWebDriver(new URL("http://localhost:4444/wd/hub"), dc));
}

public WebDriver getDriver() {
    return threadDriver.get();
}

@AfterMethod
public void closeBrowser() {
    getDriver().quit();

}

}
</code></pre>

<p>Here is an example of 1 Test. Other Tests are the same except names and numbers:</p>

<pre><code>package tests.temp;

import org.openqa.selenium.By;
import org.openqa.selenium.WebElement;
import org.testng.annotations.Test;

public class Test01 extends TestBase
{

@Test
public void testLink()throws Exception
{

    getDriver().get("http://www.yandex.ru");
    WebElement textBox = getDriver().findElement(By.name("text"));
    textBox.sendKeys("First test");
    System.out.println("First test thread-count=\"1\"");

}

}
</code></pre>

<p>An XML-file with Suite, with all this 5 Tests:</p>

<pre><code>&lt;!DOCTYPE suite SYSTEM "http://testng.org/testng-1.0.dtd"&gt;
&lt;suite name="Parallel test runs" parallel="tests" thread-count="1"&gt;

&lt;test name="Test_01"&gt;
    &lt;classes&gt;
        &lt;class name="tests.temp.Test01" &gt;&lt;/class&gt;
    &lt;/classes&gt;
&lt;/test&gt;

 ...

&lt;test name="Test_05"&gt;
    &lt;classes&gt;
        &lt;class name="tests.temp.Test05" &gt;&lt;/class&gt;
    &lt;/classes&gt;
&lt;/test&gt;

&lt;/suite&gt;
</code></pre>

<p>And the last - XML-file with Suite runner:</p>

<pre><code>&lt;suite name="Parallel Test Suite"&gt;
&lt;suite-files&gt;
    &lt;suite-file path="./testRunner.xml" /&gt;
&lt;/suite-files&gt;
&lt;/suite&gt;
</code></pre>

<p>The trouble is: in case I use thread-count="1" Build log in TeamCity looks fine, but Tests runs sequentially of course.
<a href="http://i.stack.imgur.com/Bu5Pm.png" rel="nofollow">TeamCity thread = 1</a></p>

<p>If thread-count="2" or any other value - Build log looks confusing and Tests counter value is not correct. But in IDEA - everything is cool and correct!
<a href="http://i.stack.imgur.com/dFUrv.png" rel="nofollow">TeamCity thread = 2</a></p>

<p>Does anyone know how to solve this trouble??</p>