seleniumkit / gridrouter Goto Github PK
View Code? Open in Web Editor NEWSelenium-based solution to serve 1000+ browsers
License: Other
Selenium-based solution to serve 1000+ browsers
License: Other
My current architecture is
Two Selenograph services behind hardware load balacner (checking the /ping API status code)
When I wish to restart one of the machines I would like to stop it gently...
my suggestion is to change the return status code from the /ping API to be 5xx or 4xx
Or to change the return value from ok to something else (like "shunting down" or whatever).
Once no new connection will arrive it will be fully shutdown.
Or any suggestion you have...
WDYT?
Tested on Selenium 2.53.1, 3.0.1
Hey,
Not sure, but there are few changes in Selenium 3.x, see Selenium Changelog.
So, it will be useful to verify (and to adjust if needed) Selenium 3.x.
Thanks
In grid console
2016-05-05 08:11:33,024 [9602862-13] INFO RouteServlet - [SESSION_ATTEMPTED] [usertest] [10.6.33.88] [firefox] [http://10.6.33.88:4444] [1]
2016-05-05 08:11:37,980 [9602862-13] INFO RouteServlet - [SESSION_CREATED] [usertest] [10.6.33.88] [firefox] [http://10.6.33.88:4444] [0ec52d59-fc3b-492c-9c82-e2031d40d3c1] [1]
2016-05-05 08:11:41,718 [9602862-16] INFO RouteServlet - [SESSION_ATTEMPTED] [usertest] [10.6.33.88] [winium] [http://10.6.2.72:9999] [1]
2016-05-05 08:11:41,726 [9602862-16] ERROR RouteServlet - [BAD_HUB_JSON] [] [usertest] [10.6.33.88] - winium
2016-05-05 08:11:41,726 [9602862-16] ERROR RouteServlet - [SESSION_NOT_CREATED] [usertest] [10.6.33.88] [winium]
2016-05-05 08:11:45,561 [9602862-11] INFO RouteServlet - [SESSION_ATTEMPTED] [usertest] [10.6.33.88] [winium] [http://10.6.2.72:9999] [1]
2016-05-05 08:11:45,566 [9602862-11] ERROR RouteServlet - [BAD_HUB_JSON] [] [usertest] [10.6.33.88] - winium
2016-05-05 08:11:45,566 [9602862-11] ERROR RouteServlet - [SESSION_NOT_CREATED] [usertest] [10.6.33.88] [winium]
2016-05-05 08:11:48,239 [9602862-17] INFO RouteServlet - [SESSION_ATTEMPTED] [usertest] [10.6.33.88] [winium] [http://10.6.2.72:9999] [1]
2016-05-05 08:11:48,248 [9602862-17] ERROR RouteServlet - [BAD_HUB_JSON] [] [usertest] [10.6.33.88] - winium
2016-05-05 08:11:48,248 [9602862-17] ERROR RouteServlet - [SESSION_NOT_CREATED] [usertest] [10.6.33.88] [winium]
2016-05-05 08:11:51,145 [9602862-10] INFO RouteServlet - [SESSION_ATTEMPTED] [usertest] [10.6.33.88] [winium] [http://10.6.2.72:9999] [1]
2016-05-05 08:11:51,150 [9602862-10] ERROR RouteServlet - [BAD_HUB_JSON] [] [usertest] [10.6.33.88] - winium
2016-05-05 08:11:51,151 [9602862-10] ERROR RouteServlet - [SESSION_NOT_CREATED] [usertest] [10.6.33.88] [winium]
2016-05-05 08:11:51,790 [9602862-16] INFO RouteServlet - [SESSION_ATTEMPTED] [usertest] [10.6.33.88] [winium] [http://10.6.2.72:9999] [1]
2016-05-05 08:11:51,795 [9602862-16] ERROR RouteServlet - [BAD_HUB_JSON] [] [usertest] [10.6.33.88] - winium
2016-05-05 08:11:51,795 [9602862-16] ERROR RouteServlet - [SESSION_NOT_CREATED] [usertest] [10.6.33.88] [winium]
2016-05-05 08:11:51,863 [9602862-13] INFO ProxyServlet - [SESSION_DELETED] [10.6.33.88] [http://10.6.33.88:4444] [0ec52d59-fc3b-492c-9c82-e2031d40d3c1]
In Winium console
Starting Windows Desktop Driver on port 9999
09:25:59 [DEBUG] Waiting for a connection...
09:27:06 [DEBUG] ACCEPTED REQUEST POST /wd/hub/session HTTP/1.1
09:27:06 [WARN] Unknown command recived: http://localhost:9999/wd/hub/session
09:27:06 [DEBUG] Client closed
Init driver for WINIUM:
DesiredCapabilities cap = new DesiredCapabilities();
cap.setCapability("app", "C:\***-test\***\****.exe");
cap.setCapability("launchDelay", 30000);
cap.setBrowserName("winium");
driver = new RemoteWebDriver(new URL("http://usertest:[email protected]:4444/wd/hub"), cap);
Init driver for Firefox:
DesiredCapabilities cap = new DesiredCapabilities();
cap.setBrowserName("firefox");
driver = new RemoteWebDriver(new URL("http://usertest:[email protected]:4444/wd/hub"), cap);
Hi,
My assumption is that quota.xml contains static list of hubs for balancing.
What if we have scalable environment (hub servers are added dynamically) - is there any API to add new hubs to quota on top of default configuration?
We can't restart gridrouter or selenograph because it might impact existing sessions.
This is different to what I requested in #32 but related to the same scaling strategy - add new hub servers dynamically
Would be great to know what strategy you have in-house.
I am trying to test this but when i browse to the web app it gives me
HTTP ERROR 403
Problem accessing /. Reason:
Forbidden
Powered by Jetty:// 9.3.3.v20150827
Any suggestion? Thanks for any help here.
I have attempted a fresh install on numerous Ubuntu trusty servers but no matter what I try, I get a 403 or 404.
Testing in both curl and firefox, on a clean installation with default config (I did initially try custom):
http://test:test@localhost:4444/wd/hub - 404
http://test:test@localhost:4444/ - 403
Firefox also complains that neither URLs require authentication. So clearly something is awry.
# cat users.properties
test:test, user
# cat application.properties
grid.config.quota.directory=classpath:quota
grid.config.quota.hotReload=true
# cat jetty.xml
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE Configure PUBLIC "-//Jetty//Configure//EN" "http://www.eclipse.org/jetty/configure_9_0.dtd">
<Configure id="Server" class="org.eclipse.jetty.server.Server">
<Call name="addBean">
<Arg>
<New class="org.eclipse.jetty.security.HashLoginService">
<Set name="name">Selenium Grid Router</Set>
<Set name="config">/etc/grid-router/users.properties</Set>
<Set name="hotReload">true</Set>
</New>
</Arg>
</Call>
</Configure>
# cat /var/log/grid-router/grid-router.log
Java HotSpot(TM) 64-Bit Server VM warning: ignoring option MaxPermSize=512m; support was removed in 8.0
2016-02-11 13:23:17.811:INFO::main: Logging initialized @612ms
2016-02-11 13:23:17.867:INFO:oejr.Runner:main: Runner
2016-02-11 13:23:18.452:INFO:oejs.Server:main: jetty-9.3.3.v20150827
2016-02-11 13:23:25.777:INFO:/:main: No Spring WebApplicationInitializer types detected on classpath
2016-02-11 13:23:26.057:INFO:/:main: Initializing Spring root WebApplicationContext
2016-02-11 13:23:26,060 [main ] INFO ContextLoader - Root WebApplicationContext: initialization started
2016-02-11 13:23:26,307 [main ] INFO ebApplicationContext - Refreshing Root WebApplicationContext: startup date [Thu Feb 11 13:23:26 GMT+07:00 2016]; root of context hierarchy
2016-02-11 13:23:26,456 [main ] INFO BeanDefinitionReader - Loading XML bean definitions from file [/tmp/jetty-0.0.0.0-4444-grid-router-deb.war-_-any-7643648958111754567.dir/webapp/WEB-INF/classes/META-INF/spring/application-context.xml]
2016-02-11 13:23:27,373 [main ] INFO laceholderConfigurer - Loading properties file from class path resource [application.properties]
2016-02-11 13:23:27,750 [main ] INFO ConfigRepository - Loading quota configuration file [/etc/grid-router/quota/test.xml]
2016-02-11 13:23:28,018 [main ] INFO ConfigRepository - Loaded quota configuration for [test] from [/etc/grid-router/quota/test.xml]:
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<ns2:browsers xmlns:ns2="urn:config.gridrouter.qatools.ru">
<browser name="firefox" defaultVersion="33.0">
<version number="33.0">
<region name="us-west">
<host name="my-firefox33-host-1.example.com" port="4444" count="5"/>
</region>
<region name="us-east">
<host name="my-firefox33-host-2.example.com" port="4444" count="5"/>
</region>
</version>
<version number="38.0">
<region name="us-west">
<host name="my-firefox38-host-1.example.com" port="4444" count="4"/>
<host name="my-firefox38-host-2.example.com" port="4444" count="4"/>
</region>
<region name="us-east">
<host name="my-firefox38-host-3.example.com" port="4444" count="4"/>
</region>
</version>
</browser>
<browser name="chrome" defaultVersion="42.0">
<version number="42.0">
<region name="us-west">
<host name="my-chrome42-host-1.example.com" port="4444" count="1"/>
</region>
<region name="us-east">
<host name="my-chrome42-host-2.example.com" port="4444" count="4"/>
<host name="my-chrome42-host-3.example.com" port="4444" count="3"/>
</region>
</version>
</browser>
</ns2:browsers>
2016-02-11 13:23:28,026 [1-thread-1] INFO FileWatcher - Watching for changes in directory /etc/grid-router/quota
2016-02-11 13:23:28,097 [main ] INFO ContextLoader - Root WebApplicationContext: initialization completed in 2036 ms
2016-02-11 13:23:28.202:INFO:oejsh.ContextHandler:main: Started o.e.j.w.WebAppContext@5479e3f{/,file:///tmp/jetty-0.0.0.0-4444-grid-router-deb.war-_-any-7643648958111754567.dir/webapp/,AVAILABLE}{file:///usr/share/grid-router/grid-router-deb.war}
2016-02-11 13:23:28.253:INFO:oejs.ServerConnector:main: Started ServerConnector@2ab4bc72{HTTP/1.1,[http/1.1]}{0.0.0.0:4444}
2016-02-11 13:23:28.255:INFO:oejs.Server:main: Started @11064ms
Will this work on Mac machine or do I need to exclusively use Debian
I'm getting the following error after running apt-get update:
The repository 'http://ppa.launchpad.net/yandex-qatools/gridrouter/ubuntu artful Release' does not have a Release file.
I've also tried cloning the gridrouter-deb-master repository and building from that but I'm stuck on the following error:
Now signing changes and any dsc files... signfile dsc yandex-grid-router_1.27-1.dsc Ivan Krutov <[email protected]> gpg: skipped "Ivan Krutov <[email protected]>": No secret key gpg: /tmp/debsign.eCi108TX/yandex-grid-router_1.27-1.dsc: clearsign failed: No secret key
RemoteWebDriver::create( 'http://test:test@ip:4444/wd/hub' )
Error: Cannot create session on any available node
Hi
When scaling Selenium infrastructure in AWS we make decision based on number of new sessions count on Hub. This way we can have 1 static Hub and 0-X dynamic Node servers.
Using Gridrouter - selection logic will return error in case of no any hubs are available. We are planning 1 server to host Gridrouter and 0-X dynamic servers hosting Hub+Nodes.
Is there any potential workaround for this?
Hi
Is is possible to change the port of Grid router debian package . i.e from 4444 to 80 or 443
Thanks & regards
I am plagued by this scenario:
At the router on server A, 25 new sessions are attempted at once.
The only configured hub on Server B responds to the first request and the test starts running, then the second and the rest runs, and the third, and so on - with things getting slower and slower due to network traffic as the tests start.
The router gives up on waiting for slow portion of these session requests, and:
WARN RouteServlet - [SESSION_FAILED] [global] [172.18.0.1] [firefox] [http://15.32.16.63:4444] - Error forwarding the new session Request timed out waiting for a node to become available.
It then fires up another bunch of new session requests... BUT, the original session requests are still processed on the hub after some delay, with the second lot of requests simply queued behind these, the sessions are started but the client has forgotten about it. Then, due to further network delay, the Router ends more extra sessions, and needless to say everything snowballs into a nightmare of errors.
So, my question is a simple one... can I increase this session request timeout? Is there a wiser solution to prevent this domino effect?
I'm running very powerful enterprise computational hardware, on which I've managed to run between 75 and 150 concurrent tests depending on number of CPUs, before using gridrouter. But these network issues are my main contender. Is the solution to use lighter 2 core machines? Still, though, even with just 25 concurrent sessions, timeouts seem to be a problem.
Thanks again guys.
Meta -
OS: Ubuntu 12.04
Selenium Version: 3.5.2
Browser: Firefox
Browser Version:
Expected Behavior -
I try to execute a test on Firefox with selenograph (contains GridRouter)
Actual Behavior -
When I execute a test on Firefox, I have this error "Session [null] not available and is not among the last 1000 terminated sessions".
But it's OK when I execute on Chrome,Chrome Headless or IE.
Steps to reproduce -
Create a grid router.
Configure your Grid Router with a profil.xml that contains firefox.
Execute a test using your Grid Router IP and firefox capabilities.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.