1

Timed out waiting for driver server to shutdown.

Caused by: org.openqa.selenium.net.UrlChecker$TimeoutException: Timed out waiting for http://localhost:56561/shutdown to become unavailable after 3005 ms

I have no problems with my code. When I run one by one, it doesn't show error. But when I run many test some show error. This problem happens when I run many tests and I use driver.quit().

I know when We use driver.quit() Selenium has 3 seconds to kill the browser, if it doesn't happen this problem can happen.

I'm using Macbook pro, so I don't have problem with perform

org.openqa.selenium.WebDriverException: Timed out waiting for driver server to shutdown.
Build info: version: '4.2.2', revision: '683ccb65d6'
System info: host: 'inote689', ip: '2804:14d:5cd4:6383:0:0:0:8b6%en0', os.name: 'Mac OS X', os.arch: 'aarch64', os.version: '12.4', java.version: '18.0.1.1'
Driver info: org.openqa.selenium.chrome.ChromeDriver
Command: [2058629088b94f1aa0e3d0c8c011bd64, quit {}]
Capabilities {acceptInsecureCerts: false, browserName: chrome, browserVersion: 103.0.5060.134, chrome: {chromedriverVersion: 103.0.5060.53 (a1711811edd7..., userDataDir: /var/folders/2v/35htd_0j4yz...}, goog:chromeOptions: {debuggerAddress: localhost:60202}, networkConnectionEnabled: false, pageLoadStrategy: normal, platformName: MAC, proxy: Proxy(), se:cdp: ws://localhost:60202/devtoo..., se:cdpVersion: 103.0.5060.134, setWindowRect: true, strictFileInteractability: false, timeouts: {implicit: 0, pageLoad: 300000, script: 30000}, unhandledPromptBehavior: dismiss and notify, webauthn:extension:credBlob: true, webauthn:extension:largeBlob: true, webauthn:virtualAuthenticators: true}
Session ID: 2058629088b94f1aa0e3d0c8c011bd64
undetected Selenium
  • 183,867
  • 41
  • 278
  • 352

1 Answers1

0

This error message...

org.openqa.selenium.WebDriverException: Timed out waiting for driver server to shutdown.
Caused by: org.openqa.selenium.net.UrlChecker$TimeoutException: Timed out waiting for http://localhost:56561/shutdown to become unavailable after 3005 ms

...implies that when you invoke driver.quit() for local executions a call gets triggered to /shutdown end-point with a timeout of 3 seconds. The WebDriver implementation would expect that a server would be able to kill and cleanup the session itself within a timespan of 3 seconds after which the process represented by the server component is also destroyed.

As Krishnan Mahadevan points out, in this usecase it looks like the server components are taking longer than 3 seconds to terminate themselves. That explains the exception you are seeing. The side effect of this is that you may see orphaned server component processes still running.

Not sure if this issue have to anythin with the item in Selenium v4.0.0-rc-1 changelist:

Sessions are now stopped when the Node is gracefully shutdown.

An immediate recomedation woould be to upgrade to Selenium Version 4.3.0

undetected Selenium
  • 183,867
  • 41
  • 278
  • 352