Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remote WebDriver fails on quit() and close() when running tests on Selenium Docker images in Kubernetes #3579

Closed
IvanVasilko opened this issue Feb 28, 2017 · 3 comments

Comments

@IvanVasilko
Copy link

IvanVasilko commented Feb 28, 2017

OS:
Linux

Selenium:
https://hub.docker.com/r/selenium/hub/~/dockerfile/

Browser:
https://hub.docker.com/r/selenium/node-chrome/~/dockerfile/

Expected Behavior -

Should quit the session when using driver.quit() and should close a browser tab when using driver.close();

Actual Behavior -

Fails with the following error:

org.openqa.selenium.WebDriverException: cannot forward the request null
Command duration or timeout: 46 milliseconds
Build info: version: '2.53.1', revision: 'a36b8b1cd5757287168e54b817830adce9b0158d', time: '2016-06-30 19:26:09'
System info: host: 'pre-built-slave-6ba2e48123144', ip: '10.0.39.57', os.name: 'Linux', os.arch: 'amd64', os.version: '3.16.0-4-amd64', java.version: '1.8.0_92-internal'
Driver info: org.openqa.selenium.remote.RemoteWebDriver
Capabilities [{applicationCacheEnabled=false, rotatable=false, mobileEmulationEnabled=false, networkConnectionEnabled=true, chrome={chromedriverVersion=2.27.440175 (9bc1d90b8bfa4dd181fbbf769a5eb5e575574320), userDataDir=/tmp/.org.chromium.Chromium.cPDAbF}, takesHeapSnapshot=true, pageLoadStrategy=normal, databaseEnabled=false, handlesAlerts=true, hasTouchScreen=true, version=56.0.2924.87, platform=LINUX, browserConnectionEnabled=false, nativeEvents=true, acceptSslCerts=true, webdriver.remote.sessionid=86ccaa5e-3c78-4e07-b84c-c246011655d6, locationContextEnabled=true, webStorageEnabled=true, browserName=chrome, takesScreenshot=true, javascriptEnabled=true, cssSelectorsEnabled=true, unexpectedAlertBehaviour=}]
Session ID: 86ccaa5e-3c78-4e07-b84c-c246011655d6
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
at java.lang.reflect.Constructor.newInstance(Constructor.java:423)
at org.openqa.selenium.remote.ErrorHandler.createThrowable(ErrorHandler.java:206)
at org.openqa.selenium.remote.ErrorHandler.throwIfResponseFailed(ErrorHandler.java:158)
at org.openqa.selenium.remote.RemoteWebDriver.execute(RemoteWebDriver.java:683)
at org.openqa.selenium.remote.RemoteWebDriver.execute(RemoteWebDriver.java:706)
at org.openqa.selenium.remote.RemoteWebDriver.quit(RemoteWebDriver.java:531)
at com.icharts.utils.BaseTest.closeAndCleanup(BaseTest.java:53)
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:498)
at org.testng.internal.MethodInvocationHelper.invokeMethod(MethodInvocationHelper.java:84)
at org.testng.internal.Invoker.invokeConfigurationMethod(Invoker.java:564)
at org.testng.internal.Invoker.invokeConfigurations(Invoker.java:213)
at org.testng.internal.Invoker.invokeConfigurations(Invoker.java:138)
at org.testng.internal.TestMethodWorker.invokeAfterClassMethods(TestMethodWorker.java:225)
at org.testng.internal.TestMethodWorker.run(TestMethodWorker.java:114)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
at java.lang.Thread.run(Thread.java:745)
Caused by: org.openqa.grid.common.exception.GridException: cannot forward the request null
at org.openqa.grid.web.servlet.handler.RequestHandler.process(RequestHandler.java:137)
at org.openqa.grid.web.servlet.DriverServlet.process(DriverServlet.java:83)
at org.openqa.grid.web.servlet.DriverServlet.doDelete(DriverServlet.java:73)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:713)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:790)
at org.seleniumhq.jetty9.servlet.ServletHolder.handle(ServletHolder.java:808)
at org.seleniumhq.jetty9.servlet.ServletHandler.doHandle(ServletHandler.java:587)
at org.seleniumhq.jetty9.server.session.SessionHandler.doHandle(SessionHandler.java:221)
at org.seleniumhq.jetty9.server.handler.ContextHandler.doHandle(ContextHandler.java:1127)
at org.seleniumhq.jetty9.servlet.ServletHandler.doScope(ServletHandler.java:515)
at org.seleniumhq.jetty9.server.session.SessionHandler.doScope(SessionHandler.java:185)
at org.seleniumhq.jetty9.server.handler.ContextHandler.doScope(ContextHandler.java:1061)
at org.seleniumhq.jetty9.server.handler.ScopedHandler.handle(ScopedHandler.java:141)
at org.seleniumhq.jetty9.server.handler.HandlerWrapper.handle(HandlerWrapper.java:97)
at org.seleniumhq.jetty9.server.Server.handle(Server.java:499)
at org.seleniumhq.jetty9.server.HttpChannel.handle(HttpChannel.java:310)
at org.seleniumhq.jetty9.server.HttpConnection.onFillable(HttpConnection.java:257)
at org.seleniumhq.jetty9.io.AbstractConnection$2.run(AbstractConnection.java:540)
at org.seleniumhq.jetty9.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.java:635)
at org.seleniumhq.jetty9.util.thread.QueuedThreadPool$3.run(QueuedThreadPool.java:555)
at java.lang.Thread.run(Thread.java:745)

Steps to reproduce

We have a Selenium hub with multiple Chrome nodes builded from official Selenium Docker images and deployed to GCP Kubernetes. To run the tests we use Jenkins.

Images:
https://hub.docker.com/r/selenium/hub/~/dockerfile/
https://hub.docker.com/r/selenium/node-chrome/~/dockerfile/

All other WebDriver functions work fine, the issue is only with quit() and close(). And even they work fine when we run the tests on SauceLabs.

public void createMyDriver() {
DesiredCapabilities capability;
capability = DesiredCapabilities.chrome();
driver = new RemoteWebDriver(new URL(HUB), capability);
}

@afterclass(alwaysRun = true)
public void closeAndCleanup() throws InterruptedException, IOException {
errorDialogChecker.reset();
toGalleryFromAnywhere();
cleanup();
driver.quit();
}

@barancev
Copy link
Member

barancev commented Mar 3, 2017

Must be a selenium-docker issue, I'll move it to the corresponding tracker.

@barancev
Copy link
Member

barancev commented Mar 3, 2017

Issue moved to SeleniumHQ/docker-selenium #402 via ZenHub

@IvanVasilko
Copy link
Author

@barancev thank you for moving to the right project

@lock lock bot locked and limited conversation to collaborators Aug 18, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants