Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.
Sign up3.0.x selenium SessionCleaner insideBrowserTimeout and clientGoneTimeout not working properly #2973
Comments
mzhang444
changed the title from
SessionCleaner insideBrowserTimeout and clientGoneTimeout not working properly
to
3.0.x selenium SessionCleaner insideBrowserTimeout and clientGoneTimeout not working properly
Oct 20, 2016
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
|
you need to specify the cleanUpCycle on the hub too |
lukeis
added
the
C-grid
label
Oct 20, 2016
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
mzhang444
Oct 20, 2016
@lukeis The hub console shows cleanupCycle for the hub and the node is 5000, the default value. Do I need to specify it explicitly in the hubConfig and nodeConfig json?
Here is the hub configuration output from hub console web page:
updated with params :
browserTimeout : 60000
debug : false
help : false
jettyMaxThreads : -1
role : hub
timeout : 120000
cleanUpCycle : 5000
maxSession : 1
capabilityMatcher : org.openqa.grid.internal.utils.DefaultCapabilityMatcher
newSessionWaitTimeout : 30000
throwOnCapabilityNotPresent : true
mzhang444
commented
Oct 20, 2016
|
@lukeis The hub console shows cleanupCycle for the hub and the node is 5000, the default value. Do I need to specify it explicitly in the hubConfig and nodeConfig json? Here is the hub configuration output from hub console web page: |
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
derinbay
Nov 1, 2016
@mzhang444 Found any solution to this? Same problem here. Instance remains grey out on selenium grid console and cannot be used.
@lukeis cleanUpCycle is set by default to 5000 and I can see it on grid console config.
derinbay
commented
Nov 1, 2016
|
@mzhang444 Found any solution to this? Same problem here. Instance remains grey out on selenium grid console and cannot be used. |
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
Eyjafjallajokull
Nov 4, 2016
I'm having the same issue using latest docker images (3.0.1).
I am manually setting -timeout and -browserTimeout when starting nodes (SE_OPTS), but still when node destroys session due to client timeout it has unavailable status in hub.
Eyjafjallajokull
commented
Nov 4, 2016
•
|
I'm having the same issue using latest docker images (3.0.1). |
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
Eyjafjallajokull
Nov 4, 2016
Ok, I have figured this out! I've previously set timout for hub to 120000 but it seems that this value should be in seconds, not milliseconds. After changing timeout to 120, browser sessions were released in hub.
My final config:
Config for the hub :
browserTimeout : 120000
timeout : 120
cleanUpCycle : 5000
maxSession : 5
newSessionWaitTimeout : -1
Eyjafjallajokull
commented
Nov 4, 2016
•
|
Ok, I have figured this out! I've previously set My final config:
|
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
derinbay
Nov 4, 2016
@Eyjafjallajokull Are you sure it's not milliseconds? Is it going down after 2 minutes, or 1.2 seconss? I'll try this one also. If that's the case documentation needs to be update.
derinbay
commented
Nov 4, 2016
|
@Eyjafjallajokull Are you sure it's not milliseconds? Is it going down after 2 minutes, or 1.2 seconss? I'll try this one also. If that's the case documentation needs to be update. |
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
derinbay
commented
Nov 5, 2016
|
All right, thanks @lukeis |
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
derinbay
Nov 5, 2016
Problem is still exist on me.
My node configuration is:
{
"capabilities": [
{
"browserName": "firefox",
"firefox_profile": "selenium",
"platform": "WIN10",
"maxInstances": 12
},
{
"browserName": "chrome",
"platform": "WIN10",
"webdriver.chrome.driver": "path\\to\\chromedriver.exe",
"maxInstances": 12
}
],
"configuration": {
"port": 5555,
"hub": "http://hubaddress/grid/register",
"maxSession": 12
}
}
and my hub is:
{
"browserTimeout": 300,
"timeout": 600
}
When a test has failed, it's remain as greyed out in console:

derinbay
commented
Nov 5, 2016
•
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
mach6
Nov 6, 2016
Member
@derinbay
You can't use that -nodeConfig on a 3.0.0+ selenium node without getting this error;
Exception in thread "main" org.openqa.grid.common.exception.GridConfigurationException: Error with the JSON of the config : Deprecated -nodeConfig file encountered. Please update the file to work with Selenium 3. See https://github.com/SeleniumHQ/selenium/wiki/Grid2#configuring-the-nodes-by-json for more details.you sure that is your node config?
|
@derinbay Exception in thread "main" org.openqa.grid.common.exception.GridConfigurationException: Error with the JSON of the config : Deprecated -nodeConfig file encountered. Please update the file to work with Selenium 3. See https://github.com/SeleniumHQ/selenium/wiki/Grid2#configuring-the-nodes-by-json for more details.you sure that is your node config? |
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
derinbay
Nov 6, 2016
@mach6 Yes, you can use -nodeConfig on selenium 3 also. Only json file is changed a bit. You can see the new file template from here: https://github.com/SeleniumHQ/selenium/blob/master/java/server/src/org/openqa/grid/common/defaults/DefaultNodeWebDriver.json
Simply remove the "configuration" tag from the file and just write the configurations at the end. Then it will be ok.
derinbay
commented
Nov 6, 2016
•
|
@mach6 Yes, you can use -nodeConfig on selenium 3 also. Only json file is changed a bit. You can see the new file template from here: https://github.com/SeleniumHQ/selenium/blob/master/java/server/src/org/openqa/grid/common/defaults/DefaultNodeWebDriver.json Simply remove the "configuration" tag from the file and just write the configurations at the end. Then it will be ok. |
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
mach6
Nov 7, 2016
Member
@derinbay yes, I know. I wrote that change ;)
my point is -- the config file you mentioned above for reproducing the issue is not a Se3 compatible one
|
@derinbay yes, I know. I wrote that change ;) my point is -- the config file you mentioned above for reproducing the issue is not a Se3 compatible one |
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
derinbay
Nov 7, 2016
@mach6 oh ok :)
Well, I don't get any exception with these configurations. Both hub and nodes are using selenium3. My only problem is browser is staying hanged when a problem occured on the test and session is deleted.
derinbay
commented
Nov 7, 2016
|
@mach6 oh ok :) |
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
mach6
Nov 8, 2016
Member
@derinbay back to my question.. are you sure the -nodeConfig you supplied above is the one you are using? it can't be... perhaps you using one that is equal and missing the configuration { } block? I'm trying to get enough details to attempt reproducing this. :)
|
@derinbay back to my question.. are you sure the |
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
derinbay
Nov 8, 2016
@mach6 Yes, sorry I'm using the file without the configuration, selenium 3 one. I wrote the wrong old json file above (I'm switching files so much while trying). But insides are same except the configuration. and there is 1 extra "register": true line
{
"capabilities": [
{
"browserName": "chrome",
"platform": "WIN10",
"webdriver.chrome.driver": "C:\\path\\to\\chromedriver.exe",
"maxInstances": 12
}
],
"port": 5555,
"hub": "http://hubaddress:4444/grid/register",
"maxSession": 12,
"register": true
}
derinbay
commented
Nov 8, 2016
•
|
@mach6 Yes, sorry I'm using the file without the configuration, selenium 3 one. I wrote the wrong old json file above (I'm switching files so much while trying). But insides are same except the configuration. and there is 1 extra "register": true line
|
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
Eyjafjallajokull
Nov 8, 2016
@derinbay this json file is not valid there is one extra "}" in the end. Remove it and try again.
Eyjafjallajokull
commented
Nov 8, 2016
|
@derinbay this json file is not valid there is one extra "}" in the end. Remove it and try again. |
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
derinbay
Nov 8, 2016
@Eyjafjallajokull Thanks, I'm working with valid json file. I wrote typos here because I can't copy paste at the moment. The problem is not about json file validation, It couldn't even work if there is a validation error on json file : ) It's about the same problem as @mzhang444 mentioned.
derinbay
commented
Nov 8, 2016
|
@Eyjafjallajokull Thanks, I'm working with valid json file. I wrote typos here because I can't copy paste at the moment. The problem is not about json file validation, It couldn't even work if there is a validation error on json file : ) It's about the same problem as @mzhang444 mentioned. |
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
mzhang444
Nov 8, 2016
@derinbay I resolved problem number 3 by setting timeout: 120 and browserTimeout: 60 in the hub. These two properties are in seconds, while others such as registerCycle, cleanupCycle are in milliseconds. The unit used among properties are not consistent and very confusing.
Problem number 1 still exists but if we configure the hub properly, the hub will instruct the node to do the right thing.
mzhang444
commented
Nov 8, 2016
|
@derinbay I resolved problem number 3 by setting timeout: 120 and browserTimeout: 60 in the hub. These two properties are in seconds, while others such as registerCycle, cleanupCycle are in milliseconds. The unit used among properties are not consistent and very confusing. Problem number 1 still exists but if we configure the hub properly, the hub will instruct the node to do the right thing. |
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
mach6
Nov 8, 2016
Member
Confirmations and observations (assuming 3.x hub and nodes, only):
- Yes, the configuration for
timeoutandbrowserTimeoutshould be specified in seconds. - The server code internally converts these to milliseconds and in some cases displays them as such. For Example:
SessionCleanerINFOmessages includes values which were internally converted usingTimeUnit.SECONDS.toMillis(value) - There is a bug in all
3.0.0-beta1 <= x <= 3.0.1versions where hubtimeoutandbrowserTimeoutvalues are read but NEVER used to start a newnode. Furthermore, the bug exists in such a fashion where thenoderegisters to thehubwith thehubvalues -- even though thenodeis not using them. - There is a bug and/or documentation issue preventing
nodesfrom registering withtimeoutandbrowserTimeoutvalues that override thehubvalues. This document suggests that this path is supported (though not recommended) -- https://github.com/SeleniumHQ/selenium/wiki/Grid2#configuring-timeouts-version-221-required.
As a work-around / because of 3 & 4, you need to sync your timeout and browserTimeout values across the hub and all nodes, specifying them in BOTH places during startup as config parameters.
I will provide fixes for 3 & 4 soon.
Observation update 1:
For SessionCleaner
- "clientGoneTimeout" =
-timeout - "insideBrowserTimeout" =
-browserTimeout - "polling every" is automatically computed and is equal to the lower non-zero value of
timeoutorbrowserTimeoutconverted to milliseconds and divided by10.. E.g.timeout = 120(sec) ,browserTimeout=100(sec) -->SessionCleanerpolling interval will be(100 * 1000) / 10=10000milliseconds (10 seconds)
|
Confirmations and observations (assuming 3.x hub and nodes, only):
As a work-around / because of 3 & 4, you need to sync your I will provide fixes for 3 & 4 soon. Observation update 1: For
|
mach6
self-assigned this
Nov 8, 2016
added a commit
to mach6/selenium
that referenced
this issue
Nov 9, 2016
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
ChrisAuto
Nov 11, 2016
I have set both timeout 120 and browserTimeout 60 for the hub and nodes to be the same and double checked this.
When tests fail the grid console is showing that it is greyed out and the console (command window) always displays "Error - Unable to kill process with PID"
Failed tests are not releasing the browser instance in the Grid Console
ChrisAuto
commented
Nov 11, 2016
•
|
I have set both timeout 120 and browserTimeout 60 for the hub and nodes to be the same and double checked this. When tests fail the grid console is showing that it is greyed out and the console (command window) always displays "Error - Unable to kill process with PID" Failed tests are not releasing the browser instance in the Grid Console |
added a commit
to mach6/selenium
that referenced
this issue
Nov 14, 2016
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
ChrisAuto
Nov 16, 2016
How do i get this fix, do i need to wait for the next build for selenium-server-standalone.jar ?
ChrisAuto
commented
Nov 16, 2016
|
How do i get this fix, do i need to wait for the next build for selenium-server-standalone.jar ? |
added a commit
to mach6/selenium
that referenced
this issue
Nov 17, 2016
mach6
closed this
in
705be71
Nov 17, 2016
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
|
Re-opening.. Only point |
mach6
reopened this
Nov 17, 2016
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
shirandedan
Mar 15, 2017
i wanna ask how you solve your problem at last..i meet the same problem as yours..
shirandedan
commented
Mar 15, 2017
|
i wanna ask how you solve your problem at last..i meet the same problem as yours.. |
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
derinbay
Mar 15, 2017
@shirandedan I solved by updating selenium from 3.0.1 to newer one. There were some commits to fixing this one after 3.0.1.
derinbay
commented
Mar 15, 2017
•
|
@shirandedan I solved by updating selenium from 3.0.1 to newer one. There were some commits to fixing this one after 3.0.1. |
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
shirandedan
Mar 15, 2017
@derinbay but what i used is selenium 3.2.0 and selenium-server 3.2.0,the latest version.
shirandedan
commented
Mar 15, 2017
|
@derinbay but what i used is selenium 3.2.0 and selenium-server 3.2.0,the latest version. |
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
shirandedan
Mar 15, 2017
@derinbay i've also tried to set up the browserTimeout and tiemout,but just it didn't work!
shirandedan
commented
Mar 15, 2017
|
@derinbay i've also tried to set up the browserTimeout and tiemout,but just it didn't work! |
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
shirandedan
Mar 15, 2017
what should i do to solve it
Config for the hub :
browserTimeout : 0
debug : false
help : false
port : 4444
role : hub
timeout : 1800
cleanUpCycle : 5000
host : 192.168.199.146
maxSession : 40
capabilityMatcher : org.openqa.grid.internal.utils.DefaultCapabilityMatcher
newSessionWaitTimeout : -1
throwOnCapabilityNotPresent : true
Config for the hub :
browserTimeout : 0
debug : false
help : false
port : 4444
role : hub
timeout : 1800
cleanUpCycle : 5000
host : 192.168.199.146
maxSession : 40
capabilityMatcher : org.openqa.grid.internal.utils.DefaultCapabilityMatcher
newSessionWaitTimeout : -1
throwOnCapabilityNotPresent : true
shirandedan
commented
Mar 15, 2017
|
what should i do to solve it |
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
ChrisAuto
Mar 17, 2017
This is still not fixed even with update to selenium 3.3.1.
Upon a failed test, the node displays in console "unable to kill process with PID XXXX".
Grid Console still shows greyed out firefox icons for every failed test. When all slots are greyed out, no more connections are allowed and the entire suite fails.
Has anyone managed to get this working. Its been a problem since last year for me (upgrades to selenium 3.x). I never had this issue previously with lower versions of selenium with lower versions of firefox. I am using remotewebdriver (grid) with firefox but only with 1 concurrent thread for the moment and i still get this issue.
If somebody has managed to get grid/remotewbdriver on 3.3.1 working with failed tests then perhaps it would be useful to share the hub config and node config. My config is the same as shirandedan above.
I just need to kill the process when a failed test occurs which should also close the related firefox browser instance that remains idle.
ChrisAuto
commented
Mar 17, 2017
•
|
This is still not fixed even with update to selenium 3.3.1. Has anyone managed to get this working. Its been a problem since last year for me (upgrades to selenium 3.x). I never had this issue previously with lower versions of selenium with lower versions of firefox. I am using remotewebdriver (grid) with firefox but only with 1 concurrent thread for the moment and i still get this issue. If somebody has managed to get grid/remotewbdriver on 3.3.1 working with failed tests then perhaps it would be useful to share the hub config and node config. My config is the same as shirandedan above. I just need to kill the process when a failed test occurs which should also close the related firefox browser instance that remains idle. |


mzhang444 commentedOct 20, 2016
•
edited
Meta -
OS: OSX 10.12 Sierre
Selenium Version: 3.0.1 java standalone server, 3.0.0.beta2 javascript client binding
Browser: Safari 10.0 (12602.1.50.0.10)
Expected Behavior -
I thought insideBrowserTimeout matches browserTimeout, and clientGoneTimeout matches timeout in the hub and node configuration parameters.
Actual Behavior -
Steps to reproduce -
java -jar selenium-server-standalone-3.0.1.jar -role hub -log hub.log -port 4444 -host <ip> -hubConfig hubConfig.json, and hubConfig.json:{ "browserTimeout": 60000, "timeout": 120000 }java -jar selenium-server-standalone-3.0.1.jar -role node -log node.log -hub $HUB_URL -nodeConfig nodeConfig.json, and nodeConfig.json:{ "capabilities": [ { "browserName":"safari", "maxInstances":1, "platform":"MAC", "version":"10", "seleniumProtocol": "WebDriver" } ], "debug": false, "proxy": "org.openqa.grid.selenium.proxy.DefaultRemoteProxy", "register": true, "registerCycle": 5000, "maxSession":6, "port":"7777" }11:40:18.427 INFO - SessionCleaner initialized with insideBrowserTimeout 0 and clientGoneTimeout 1800000 polling every 180000"browserTimeout": 60000, "timeout": 12000011:45:57.387 INFO - SessionCleaner initialized with insideBrowserTimeout 60000000 and clientGoneTimeout 60000000 polling every 6000000""browserTimeout": 60, "timeout": 120"11:52:21.122 INFO - SessionCleaner initialized with insideBrowserTimeout 60000 and clientGoneTimeout 120000 polling every 600011:56:15.237 INFO - Session 4e364367-9f6e-43fc-8591-ad27c82506c9 deleted due to client timeout.However, the hub doesn't seem to be aware of the session being deleted. From the hub console page, that instance remains grey out and cannot be used.