question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Grid Stuck When > ~500 Tests Are Executed In Parallel With ChromeDriver

See original GitHub issue

This became an issue sometime after version 2.47.1. I tested two versions, 2.48.2 and 2.52.0 and they both get stuck.

I duplicated this issue locally using a single computer with a grid running 5 instances. My real grid environment has 100 browser instances available, hence why I sometimes have 500 tests queued.

I am using ChromeDriver 2.21.

Expected Behavior

Each test iteration opens a new Chrome browser and runs the test normally.

Actual Behavior

The first set of browsers get stuck on the initial data:, screen in Chrome.

Steps to reproduce

  1. Start the hub
    • No Issue: java -jar selenium-server-standalone-2.47.1.jar -role hub
    • Issue: java -jar selenium-server-standalone-2.52.0.jar -role hub
  2. Start a node
    • No Issue: java -jar selenium-server-standalone-2.47.1.jar -role node -hub http://localhost:4444/grid/register -Dwebdriver.chrome.driver=c:\selenium_drivers\chromedriver.exe
    • Issue: java -jar selenium-server-standalone-2.52.0.jar -role node -hub http://localhost:4444/grid/register -Dwebdriver.chrome.driver=c:\selenium_drivers\chromedriver.exe
  3. Run the test
    • mvn clean test
    • Three files below

testng.xml

<suite name="Suite" data-provider-thread-count="100" parallel="methods" thread-count="10">
    <test name="Test">
        <classes>
            <class name="com.mytest.AppTest"/>
        </classes>
    </test>
</suite>

src/test/java/com/mytest/AppTest.java

package com.mytest;

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

import org.openqa.selenium.WebDriver;
import org.openqa.selenium.remote.DesiredCapabilities;
import org.openqa.selenium.remote.RemoteWebDriver;
import org.testng.annotations.DataProvider;
import org.testng.annotations.Test;

public class AppTest {

    @Test(dataProvider = "dp")
    public void test1() throws MalformedURLException {
        DesiredCapabilities caps = DesiredCapabilities.chrome();
        WebDriver driver = new RemoteWebDriver(new URL("http://localhost:4444/wd/hub"), caps);
        driver.get("http://google.com");
        driver.quit();
    }

    @Test(dataProvider = "dp")
    public void test2() throws MalformedURLException {
        DesiredCapabilities caps = DesiredCapabilities.chrome();
        WebDriver driver = new RemoteWebDriver(new URL("http://localhost:4444/wd/hub"), caps);
        driver.get("http://google.com");
        driver.quit();
    }

    @Test(dataProvider = "dp")
    public void test3() throws MalformedURLException {
        DesiredCapabilities caps = DesiredCapabilities.chrome();
        WebDriver driver = new RemoteWebDriver(new URL("http://localhost:4444/wd/hub"), caps);
        driver.get("http://google.com");
        driver.quit();
    }

    @DataProvider(name = "dp", parallel = true)
    public static Object[][] dp() {
        return new Object[500][0];
    }
}

pom.xml

<project>
    <modelVersion>4.0.0</modelVersion>
    <groupId>com.mytest</groupId>
    <artifactId>ManyTests</artifactId>
    <version>0.0.1-SNAPSHOT</version>

    <build>
        <plugins>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-surefire-plugin</artifactId>
                <version>2.19.1</version>
                <configuration>
                    <suiteXmlFiles>
                        <suiteXmlFile>testng.xml</suiteXmlFile>
                    </suiteXmlFiles>
                </configuration>
            </plugin>
        </plugins>
    </build>

    <dependencies>
        <dependency>
            <groupId>org.testng</groupId>
            <artifactId>testng</artifactId>
            <version>6.9.10</version>
        </dependency>
        <dependency>
            <groupId>org.seleniumhq.selenium</groupId>
            <artifactId>selenium-server</artifactId>
            <version>2.52.0</version>
        </dependency>
        <dependency>
            <groupId>org.seleniumhq.selenium</groupId>
            <artifactId>selenium-java</artifactId>
            <version>2.52.0</version>
        </dependency>
    </dependencies>
</project>

Issue Analytics

  • State:closed
  • Created 8 years ago
  • Reactions:2
  • Comments:6 (2 by maintainers)

github_iconTop GitHub Comments

1reaction
bdabburi3091commented, Jan 13, 2017

is there any updates on this? we are facing similar issue on 2.53.0 version also

1reaction
jimpatel90commented, Apr 22, 2016

is there any updates on this? we are facing similar issue.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Grid Stuck When > ~500 Tests Are Executed In Parallel With ...
I am using ChromeDriver 2.21. Expected Behavior. Each test iteration opens a new Chrome browser and runs the test normally. Actual Behavior. The ......
Read more >
Parallel Execution in Selenium: Session Handling & TestNG ...
During test execution, the Selenium WebDriver has to interact with the browser all the time to execute given commands. At the time of...
Read more >
Parallel testing on multiple Virtual Machine using selenium ...
I am using Selenium webdriver and selenium 2.19 jar to distrivbute the execution of tets cases on multiple machine for a particulra browser....
Read more >
selenium - Parallel = "tests" not working in Grid - Stack Overflow
Based on your code, this can only happen if your driver is static. Basically, you should have two instances of driver to interact...
Read more >
Chrome doesn't start or crashes immediately - ChromeDriver
First, try launching the same Chrome binary that your test uses from a normal user command prompt (check your chromedriver.log file to see...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found