sterodium / selenium-grid-extensions

Set of Selenium Grid extensions for a better UI tests.
Apache License 2.0
46 stars 23 forks source link

Problem when running multiple sikuli-selenium tests in parallel #44

Closed braindonor closed 8 years ago

braindonor commented 8 years ago

Hi,

I'm getting some failures when running tests in parallel using testNG. I have a single hub and 5 nodes. If I run a single thread then everything is fine, but when running multiple threads most of the tests fail with the error below.

I'm currently using Selenium version 2.53.0 and sikuli-extension 0.6.

Any pointers to help me solve this issue would be greatly appreciated.

Thanks,

Pentti

Error returned from test:

java.lang.AssertionError: Widget desktop invocation failed (expected 200, but was 500):

Error 500

HTTP ERROR: 500

Problem accessing /grid/admin/HubRequestsProxyingServlet/session/20694a4d-0e8a-478b-ae99-25461ac256c0/SikuliExtensionServlet/desktop. Reason:

    java.lang.NullPointerException


Powered by Jetty://

Hub Stacktrace:

11:59:11.673 INFO - Retrieving remote host for session: 88dc643f-5944-4a06-92da-1c02 26bb7a21 2016-05-19 11:59:11.673:WARN:osjs.ServletHandler:qtp24377049-1131: /grid/admin/HubRequestsProxyingServlet/session/88dc643f-5944-4a06-92da-1c0226bb7a21/SikuliExtensionServlet/target-factory java.lang.NullPointerException at io.sterodium.extensions.hub.proxy.session.SeleniumSessions.refreshTimeout(SeleniumSessions.java:35) at io.sterodium.extensions.hub.proxy.HubRequestsProxyingServlet.createExtensionClient(HubRequestsProxyingServlet.java:83) at io.sterodium.extensions.hub.proxy.HubRequestsProxyingServlet.forwardRequest(HubRequestsProxyingServlet.java:63) at io.sterodium.extensions.hub.proxy.HubRequestsProxyingServlet.doPost(HubRequestsProxyingServlet.java:47) at javax.servlet.http.HttpServlet.service(HttpServlet.java:707) 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(Unknown Source)

echoAlexey commented 8 years ago

When you run our tests in parallel, do they share same desktop? Each node should have dedicated display in linux.

braindonor commented 8 years ago

Thanks for replying so quickly. Yes each node is running a dedicated display, and I'm launching a single browser instance on each node.

The issue occurs when running the test on a selenium grid which runs on windows VM's and also when I run the test on a grid using docker containers.

braindonor commented 8 years ago

After some further investigation I believe that calling webDriver.quit() is causing the exception. I'm now calling close() at the end of each thread. I then call quit() for each webDriver when all the threads have completed.

echoAlexey commented 8 years ago

Hi, So you were able to resolve this? Keep in mind, we are using selenium session to properly route requests from hub to node. Once session is closed, hub will unable to tell us where request should be forwarded.

Can I close the issue?

braindonor commented 8 years ago

Thanks I'll read up on selenium sessions.

Yes, please close the issue.