Skip to end of metadata
Go to start of metadata

To stop tests from timing out when you're already using all your Sauce Labs parallel slots, you need to limit the number of threads.

The Sauce Labs Parallelized JUnit runner uses the junit.parallel.threads System property to control how many threads it runs. You can set this by updating the <threadcount> in your Maven pom.xml file, as shown in the example. Similarly, if you were using Ant as your project comprehension tool, you would update the <threadCount> attribute in your Parallel task. 

Match Thread Count to Concurrency Limit

You should match your thread count to your concurrency limit, which is shown in the My Account section of your user profile information on the Sauce Labs dashboard.  

Example of Updating the Threadcount in a Maven pom.xml file
<build>
        <plugins>
            <plugin>
                <artifactId>maven-compiler-plugin</artifactId>
                <version>3.0</version>
                <configuration>
                    <source>1.6</source>
                    <target>1.6</target>
                </configuration>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-surefire-plugin</artifactId>
                <version>2.12.4</version>
                <configuration>
                    <parallel>classes</parallel>
                    <threadCount>20</threadCount>
                    <redirectTestOutputToFile>true</redirectTestOutputToFile>
                </configuration>
            </plugin>
        </plugins>
</build>
  • No labels