What causes "Timed out waiting for driver server to shutdown"?

3,766 views
Skip to first unread message

skd

unread,
Jan 18, 2017, 11:22:49 AM1/18/17
to Selenium Users
I occasionally see failures in my regression tests with this error. Last night 107 out of 396 tests failed. The failures are on the call to driver.quit() in my tearDown() method. I'm using ChromeDriver v2.27 and TestNG v6.9.12.

org.openqa.selenium.WebDriverException: Timed out waiting for driver server to shutdown.
Build info: version: '3.0.1', revision: '1969d75', time: '20116-10-18 09:48:19 -0700'
System info: host: 'EARLE', ip: '128.2..176.234', os.name: 'Windows 7', os.arch: 'amd64', os.version: '6.1', java.version: '1.8.0_45'
Driver info: driver.version: RemoteWebDriver
at org.openqa.selenium.remote.service.DriverService.stop(DriverService.java:200)
at org.openqa.selenium.remote.service.DriverCommandExecutor.execute(DriverCommandExecutor.java:94)
at org.openqa.selenium.remote..RemoteWebDriver.execute(RemoteWebDriver.java:601)
at org.openqa.selenium.remmote.RemoteWebDriver.execute(RemoteWebDriver.java:658)
at org.openqa.selenium.remote.RemoteWebDriver.quit(RemoteWebDriver.java:497))
at edu.cmu.pact.qa.html5.DefaultTestCase.tearDown(DefaultTestCase.java:46)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:497)
at org.testng.internal.MethodInvocationHelper.invokeMethod(MethodInvocationHelper.java:100)
at org.testng.internal.Invoker.invokeConfigurationMethod(Invoker.java:515)
at org.testng.internal.Invoker.invokeConfigurations(Invoker.java:216)
at org.testng.internal.Invoker.invokeConfigurations(Invoker.java:143)
at org.testng.internal.TestMethodWorker.invokeAfterClassMethods(TestMethodWorker.java:217)
at org.testng.internal.TestMethodWorker.run(TestMethodWorker.java:115)
at org.testng.TestRunner.privateRun(TestRunner.java:746)
at org.testng.TestRunner.run(TestRunner.java:600)
at org.testng.SuiteRunner.runTest((SuiteRunner.java:366)
at org.testng.SuiteRunner.runSequentially(SuiteRunner.java:361)
at org.testng.SuiteRunner.privateRun(SuiteRunner.java:3319)
at org.testng.SuiteRunner.run(SuiteRunner.java:268)
at org.testng.SuiteRunnerWorker.runSuite(SuiteRunnerWorker.java:552)
at org.testng.SuiteRunnerWorker.run(SuiteRunnerWorker.java:86)
at org.testng.TestNG..runSuitesSequentially(TestNG.java:1264)
at org.testng.TestNG.runSuitesLocally(TestNG.java:1189)
at org.testng.TestNG.runSuites(TestNG.java::1104)
at org.testng.TestNG.run(TestNG.java:1076)
at org.testng.TestNG.privateMain(TestNG.java:1405)
at org.testng.TestNG.main(TestNG.java:1374)
Caused by: org.openqa.selenium.net.UrlChecker$TimeoutException: Tiimed out waiting for http://localhost:6000/shutdown to become unavailable after 4249 ms
at org.openqa.selenium.net.UrlChecker.waitUntilUnavailable(UrlChecker.java:146)
at org.openqa.selenium.remote.service.DriverService.stop(DrivverService.java:195)
... 29 more
Caused by: com.gooogle.common.util.concurrent.UncheckedTimeoutException: java.util.concurrent.TimeoutException
at com.google.common.util.concurrent.SimpleTimeLimiter.callWithTimeeout(SimpleTimeLimiter.java:143)
at org.openqa.selenium.net.UrlChecker.waitUntilUnavailable(UrlChecker.java:120)
... 30 more
Caused bby: java.util.concurrent.TimeoutException
at java.util.conccurrent.FutureTask.get(FutureTask.java:205)
at com.google.common.util.concurrent.SimpleTimeLimiter.calllWithTimeout(SimpleTimeLimiter.java:130)
... 31 more

⇜Krishnan Mahadevan⇝

unread,
Jan 18, 2017, 10:48:27 PM1/18/17
to Selenium Users
The Server components [ geckodriver for firefox, chromedriver for chrome and IEDriverServer for IE ] have an endpoint exposed [ http://ip:port/shutdown ] which when invoked causes the server component to gracefully shut itself down [ The process gets terminated ].

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

In your case, 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 what can cause this behaviour. I think it depends on what server component is involved, and then taking its relevant logs, and perhaps file an issue against the respective server component [ geckodriver (or) chromedriver (or) IEDriverServer (or) EdgeDriver ]

Thanks & Regards
Krishnan Mahadevan

"All the desirable things in life are either illegal, expensive, fattening or in love with someone else!"
My Scribblings @ http://wakened-cognition.blogspot.com/
My Technical Scribbings @ http://rationaleemotions.wordpress.com/

--
You received this message because you are subscribed to the Google Groups "Selenium Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to selenium-users+unsubscribe@googlegroups.com.
To post to this group, send email to selenium-users@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/selenium-users/be876b81-2aa2-46af-ba3b-b62f5a047d52%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

skd

unread,
Jan 19, 2017, 12:07:15 PM1/19/17
to Selenium Users
Thanks for the explanation, Krishnan. Unfortunately, the machine that runs our regression tests is old and slow, which might explain why a timeout of 3 seconds is not long enough. We plan to replace the machine with a newer faster one soon, but in the meantime, is there a way to increase this timeout?

Thanks!
To unsubscribe from this group and stop receiving emails from it, send an email to selenium-user...@googlegroups.com.
To post to this group, send email to seleniu...@googlegroups.com.
Reply all
Reply to author
Forward
0 new messages