I am using AWS EC2 instances to create a Selenium Grid. I have one instance acting as the Hub and other instances acting as nodes.
Once I terminate the nodes, they still remain in the grid for quite sometime (like 15-20 minutes) before being completely removed, therefore, the API is returning incorrect values:
For example, the API is returning:
"slotCounts": {
"free": 9,
"total": 10
},
But really, there are ONLY 4 slots total, because the other nodes are no longer connected. Is there a configuration setting that will remove the nodes from grid faster after there is no longer a connection?
I start the Hub like this:
java -jar selenium-server-standalone-3.141.59.jar -role hub -port 4444;
And the clients like this:
java -jar -Dwebdriver.chrome.driver=chromedriver selenium-server-standalone-3.141.59.jar -role node -hub http://10.0.1.119:4444/grid/register -browser browserName=chrome,maxInstances=2,version=latest,seleniumProtocol=WebDriver
The nodes do eventually disappear from the grid but only after they have been quit (by quit, I mean after the computer that runs the node has been shutdown) for quite awhile (maybe 10-20 mins).
I looked at this Stack Overflow question: SO
And I can't figure out if I need to set nodePolling
, timeout
, browsertimout
or a combination of them?
Update: I just tested it again, and after the computer that runs the nodes was shutdown, it took around 20-22 mins for the grid to reflect that in the API.