Comments (6)
Hi, can you provide some more information as to how things start to mess up?
Have you also configured MaxInstances? can you post some of your grid config
from testcafe-browser-provider-selenium.
Hi @alexschwantes
Lets say that I have a grid with 100 nodes connected to it and I set the concurrency to 100 as well.
Now I'm starting another testcafe job, but because there aren't free nodes he doesn't wait in a queue and it also stops the first running job (it is interfering with it) so it hangs.
Am I clear enough?
Hub config:
Config for the hub :
browserTimeout : 18000
debug : false
jettyMaxThreads : -1
host : 100.101.248.165
port : 4444
role : hub
timeout : 18000
cleanUpCycle : 5000
capabilityMatcher : org.openqa.grid.internal.utils.DefaultCapabilityMatcher
newSessionWaitTimeout : -1
throwOnCapabilityNotPresent : true
registry : org.openqa.grid.internal.DefaultGridRegistry
Node config:
browserTimeout: 18000
debug: false
jettyMaxThreads: -1
host: IP
port: 5555
role: node
timeout: 18000
cleanUpCycle: 5000
maxSession: 3
capabilities: Capabilities {applicationName: , browserName: chrome, maxInstances: 1, platform: LINUX, platformName: LINUX, seleniumProtocol: WebDriver, server:CONFIG_UUID: 81362dd6-9c1a-4011-a300-8cd..., version: 87.0.4280.66}
downPollingLimit: 2
hub: http://selenium-selenium-hub:4444/grid/register
id: http://IP:5555
nodePolling: 5000
nodeStatusCheckTimeout: 5000
proxy: org.openqa.grid.selenium.proxy.DefaultRemoteProxy
register: true
registerCycle: 5000
remoteHost: http://IP:5555
unregisterIfStillDownAfter: 60000
from testcafe-browser-provider-selenium.
From the node config, you have maxSessions set to 3 which says that the node can run up to 3 sessions on any of the configured browsers at once, but you have maxInstances for chome set to only 1. This will limit the node to only ever be able to run 1 chrome instance at a time. To run 3 chrome browsers on that node you need to set maxInstances to be 3.
ie.
maxSession: 3
capabilities: Capabilities {applicationName: , browserName: chrome, maxInstances: 3, ....
The following part is perhaps a bit unexpected though. I would not expect the second job to interfere with the first job...
Now I'm starting another testcafe job, but because there aren't free nodes he doesn't wait in a queue and it also stops the first running job (it is interfering with it) so it hangs.
Anyway, give the modified node config a try and let me know how you go
What you want to see in the grid console is something like this, but with 3 chrome icons for each node. At the moment with your configuration it would only show 1 chrome icon per node.
from testcafe-browser-provider-selenium.
Hi @alexschwantes, I'm working with @doronsever and it seems that raising the maxInstances to 3 didn't solved the problem. To give more details:
Once we're running another testcafe job, we're seeing the following excpetion:
unhandledRejection (caught in mgmt sdk) --> {"code":"E1038","data":["selenium:chrome","WebDriverError: Error forwarding the new session Empty pool of VM for setup Capabilities {browserName: chrome, goog:chromeOptions: {args: [headless, --use-fake-ui-for-media-stream, --use-fake-device-for-media..., --allow-http-screen-capture, --disable-web-security, --allow-insecure-localhost, --window-size=1440,900]}}\n at Object.checkLegacyResponse (/<JENKINS_WORKSPACE>/node_modules/selenium-webdriver/lib/error.js:553:15)\n at parseHttpResponse (/<JENKINS_WORKSPACE>/node_modules/selenium-webdriver/lib/http.js:647:13)\n at Executor.execute (/<JENKINS_WORKSPACE>/node_modules/selenium-webdriver/lib/http.js:581:28)\n at runMicrotasks (<anonymous>)\n at processTicksAndRejections (internal/process/task_queues.js:93:5)"]}
It seems that an exception is thrown if testcafe can't find a "free" browser to use. Because of that, the first job also fails because the second one sometimes manages to "steal" free browsers.
Besides, adding nodes, do we have the option to tell testcafe to wait (until X minutes timeout) for a free browser/node?
from testcafe-browser-provider-selenium.
Hi so I ran a little test to check how this would work. Fos simplicity I ran everything locally.
I spun up a selenium hub and node with 5 chrome instances on the same node, all without specifying any custom configuration.
I have two simple tests in the test suite that take about 13 senconds each to run.
- If I run one
testcafe -c 2 selenium:chrome tests/test.js
, I can see in the selenium grid console web page that it is utilising two chrome browsers. - If I then run 2 of these tests simultaneously, I can see that it is utilising 4 chrome instances.
- If I run 3 of these tests simultaneously, I can see that it uses all 5 available instances, and that it is queuing one remainder test as there are not enough free browsers.
- I also tried this with two nodes (each with 5 chrome instances) and the results were the same, but with the tests running across both nodes.
I ran this test with selenium 3, what version are you using?
Perhaps you could try testing something like this with a smaller number of total nodes to test it out?
I also did some digging and found That exception "Error forwarding the new session Empty pool of VM" means that your Selenium Grid doesn't have any node available with a browser that has the desired capabilities.
Also someone having the issue when using the selenium plugin for Jenkin.
Might need some more information on how exactly you have jenkins, selenium and testcafe configured. Are you using the selenium plugin for jenkins or running your own selenium hub/nodes. How/where are they run? Is testcafe run from a jenkins job that is using the same configuration each time its run?
Are you running all the jobs from Jenkins? Is the testcafe command executed from the Jenkins host? If so are you able to monitor the cpu/ram/network performance of Jenkins when running your tests to make sure you aren't hitting a bottleneck.
Are you able to attach a screenshot of your selenium console http://[selenium-hub-ip]:4444/grid/console
from testcafe-browser-provider-selenium.
Closing issue as it has been inactive for quite some time.
from testcafe-browser-provider-selenium.
Related Issues (20)
- How to specify/pass browser version? HOT 3
- Video recording not working in chrome docker HOT 3
- WebDriverError: java.net.ConnectException: Connection refused HOT 7
- Package not working for android devices HOT 4
- Can i pass user agent to use android chrome with this package HOT 2
- Selenium Grid v4-alpha-6 with https not working with this plugin HOT 9
- Proxy with testcafe-browser-provider-selenium HOT 1
- Unable to pass browser CLI argument as environment variable (parsing error) HOT 3
- Multi Window Error while running test cases HOT 7
- How is the plugin running with testcafe behind the hood? HOT 2
- Run the testcafe on hosted selenium grid HOT 2
- Testcafe plugin not working with Selenium Grid implementation in K8s HOT 2
- Timeout error when try to run test using GitLab Pipeline HOT 5
- cannot connect to selenium chrome container HOT 3
- Incorrect tests behaviour when run concurrently on chrome grid HOT 3
- New version coming?? HOT 3
- Tests against a remote Selenium Grid time out because Testcafé seems to try making the Grid browser reach the host it runs on HOT 5
- webdriver error HOT 1
- testcafe server must be accessible from selenium-node? HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from testcafe-browser-provider-selenium.