Skip to content

[🐛 Bug]: chromedriver service is not killed  #10795

@gravityvi

Description

@gravityvi

What happened?

Even after calling driver.quit. Not able to start chrome driver on the same port. Server is not getting killed and the port is not released.

How can we reproduce the issue?

const webdriver = require('selenium-webdriver');
const chrome = require('selenium-webdriver/chrome');
const BROWSER_NAME = webdriver.Browser.CHROME;

async function getDriver() {
  let service = new chrome.ServiceBuilder(require('chromedriver').path).setPort(9515);

  service.setStdio(['pipe', process.stdout, process.stderr]);

  return new webdriver.Builder()
    .setChromeService(service)
    .forBrowser(BROWSER_NAME)
    .build();
}

async function runTestWithCaps() {
  for (i = 0; i <= 5; i++) {
    try {
      driver = await getDriver();
      await driver.get("http://www.google.com");
      await driver.quit();
    } catch(err) {
      console.log(err);
    }
  }
}

runTestWithCaps();

Relevant log output

tarting ChromeDriver 102.0.5005.61 (0e59bcc00cc4985ce39ad31c150065f159d95ad3-refs/branch-heads/5005@{#819}) on port 9515
Only local connections are allowed.
Please see https://chromedriver.chromium.org/security-considerations for suggestions on keeping ChromeDriver safe.
ChromeDriver was started successfully.


Starting ChromeDriver 102.0.5005.61 (0e59bcc00cc4985ce39ad31c150065f159d95ad3-refs/branch-heads/5005@{#819}) on port 9515
Only local connections are allowed.
Please see https://chromedriver.chromium.org/security-considerations for suggestions on keeping ChromeDriver safe.
[1655906636.622][SEVERE]: bind() failed: Address already in use (48)
IPv4 port not available. Exiting...


Starting ChromeDriver 102.0.5005.61 (0e59bcc00cc4985ce39ad31c150065f159d95ad3-refs/branch-heads/5005@{#819}) on port 9515
Only local connections are allowed.
Please see https://chromedriver.chromium.org/security-considerations for suggestions on keeping ChromeDriver safe.
[1655906639.852][SEVERE]: bind() failed: Address already in use (48)
IPv4 port not available. Exiting...


Starting ChromeDriver 102.0.5005.61 (0e59bcc00cc4985ce39ad31c150065f159d95ad3-refs/branch-heads/5005@{#819}) on port 9515
Only local connections are allowed.
Please see https://chromedriver.chromium.org/security-considerations for suggestions on keeping ChromeDriver safe.
[1655906642.727][SEVERE]: bind() failed: Address already in use (48)
IPv4 port not available. Exiting...

Starting ChromeDriver 102.0.5005.61 (0e59bcc00cc4985ce39ad31c150065f159d95ad3-refs/branch-heads/5005@{#819}) on port 9515
Only local connections are allowed.
Please see https://chromedriver.chromium.org/security-considerations for suggestions on keeping ChromeDriver safe.
[1655906647.038][SEVERE]: bind() failed: Address already in use (48)
IPv4 port not available. Exiting...

Starting ChromeDriver 102.0.5005.61 (0e59bcc00cc4985ce39ad31c150065f159d95ad3-refs/branch-heads/5005@{#819}) on port 9515
Only local connections are allowed.
Please see https://chromedriver.chromium.org/security-considerations for suggestions on keeping ChromeDriver safe.
[1655906651.742][SEVERE]: bind() failed: Address already in use (48)

Operating System

macOS Monterey

Selenium version

4.2.2

What are the browser(s) and version(s) where you see this issue?

chrome 102

What are the browser driver(s) and version(s) where you see this issue?

chromedriver 102

Are you using Selenium Grid?

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    C-nodejsJavaScript BindingsI-defectSomething is not working as intended

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions