SeleniumHQ / selenium-google-code-issue-archive

Archive, please see main selenium repo
https://github.com/seleniumhq/selenium
345 stars 195 forks source link

WebDriverWait waited too long when FORWARDING_TO_NODE_FAILED #5691

Closed lukeis closed 8 years ago

lukeis commented 8 years ago

Originally reported on Google Code with ID 5691

Hi,
This is probably a rare occurance.  Looks like some unspecified incident happened to
either the selenium hub or the node that was running the browser.  At the time of this
occurance, I had a WebDriverWait waiting on something.

My wait code (POLLING_TIME is 50):
        wait = (WebDriverWait)
                new WebDriverWait(SHARED_DRIVER, 5).pollingEvery(POLLING_TIME,
                        TimeUnit.MILLISECONDS);
        acknowledgeButton = wait.until(
 ExpectedConditions.elementToBeClickable(By.name("acknowledgeButton")));

The first exception shows it waited much longer than 5 seconds:
May 23, 2013 9:38:58 AM org.openqa.selenium.support.ui.ExpectedConditions findElement
WARNING: WebDriverException thrown by findElement(By.name: acknowledgeButton)
org.openqa.selenium.WebDriverException: findElement execution failed;
 Chrome did not respond to 'ExecuteJavascript'. Elapsed time was 1733573 ms. (WARNING:
The server did not provide any stacktrace information)
Command duration or timeout: 1727.88 seconds
Build info: version: '2.29.0', revision: '58258c3', time: '2013-01-17 22:46:35'
System info: os.name: 'Windows 7', os.arch: 'x86', os.version: '6.1', java.version:
'1.7.0_05'
Session ID: c97877fb483caf15f39085e4765d871f
Driver info: org.openqa.selenium.chrome.ChromeDriver
Capabilities [{platform=XP, chrome.chromedriverVersion=26.0.1383.0, acceptSslCerts=false,
javascriptEnabled=true, browserName=chrome, rotatable=false, locationContextEnabled=false,
version=26.0.1410.64, cssSelectorsEnabled=true, databaseEnabled=false, handlesAlerts=true,
browserConnectionEnabled=false, nativeEvents=true, webStorageEnabled=true, applicationCacheEnabled=false,
takesScreenshot=true}]
Command duration or timeout: 1728.21 seconds
Build info: version: '2.30.0', revision: 'dc1ef9ceb805a672f56dc49198f9ffbd4ca345c7',
time: '2013-02-19 09:14:38'
System info: os.name: 'Linux', os.arch: 'amd64', os.version: '2.6.18-194.32.1.el5',
java.version: '1.6.0_27'
Session ID: 14df52ce-d25c-4b60-a4ac-837d9421dc2e
Driver info: org.openqa.selenium.remote.RemoteWebDriver
Capabilities [{platform=XP, chrome.chromedriverVersion=26.0.1383.0, acceptSslCerts=false,
javascriptEnabled=true, browserName=chrome, rotatable=false, locationContextEnabled=false,
webdriver.remote.sessionid=14df52ce-d25c-4b60-a4ac-837d9421dc2e, version=26.0.1410.64,
cssSelectorsEnabled=true, databaseEnabled=false, handlesAlerts=true, browserConnectionEnabled=false,
nativeEvents=true, webStorageEnabled=true, applicationCacheEnabled=false, takesScreenshot=true}]
    at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
    at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:39)
    at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27)
    at java.lang.reflect.Constructor.newInstance(Constructor.java:513)
    at org.openqa.selenium.remote.ErrorHandler.createThrowable(ErrorHandler.java:187)
    at org.openqa.selenium.remote.ErrorHandler.throwIfResponseFailed(ErrorHandler.java:145)
    at org.openqa.selenium.remote.RemoteWebDriver.execute(RemoteWebDriver.java:554)
    at org.openqa.selenium.remote.RemoteWebDriver.findElement(RemoteWebDriver.java:307)
    at org.openqa.selenium.remote.RemoteWebDriver.findElementByName(RemoteWebDriver.java:380)
    at org.openqa.selenium.By$ByName.findElement(By.java:292)
    at org.openqa.selenium.remote.RemoteWebDriver.findElement(RemoteWebDriver.java:299)
    at sun.reflect.GeneratedMethodAccessor15.invoke(Unknown Source)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
    at java.lang.reflect.Method.invoke(Method.java:597)
    at org.openqa.selenium.support.events.EventFiringWebDriver$2.invoke(EventFiringWebDriver.java:101)
    at $Proxy7.findElement(Unknown Source)
    at org.openqa.selenium.support.events.EventFiringWebDriver.findElement(EventFiringWebDriver.java:180)
    at org.openqa.selenium.support.ui.ExpectedConditions.findElement(ExpectedConditions.java:523)
    at org.openqa.selenium.support.ui.ExpectedConditions.access$000(ExpectedConditions.java:39)
    at org.openqa.selenium.support.ui.ExpectedConditions$4.apply(ExpectedConditions.java:130)
    at org.openqa.selenium.support.ui.ExpectedConditions$4.apply(ExpectedConditions.java:126)
    at org.openqa.selenium.support.ui.ExpectedConditions$12.apply(ExpectedConditions.java:355)
    at org.openqa.selenium.support.ui.ExpectedConditions$12.apply(ExpectedConditions.java:348)
    at org.openqa.selenium.support.ui.FluentWait.until(FluentWait.java:208)

After this, since the scenario failed, I try to take a screenshot and get this exception:
 [main] DEBUG com.etrade.neo.appscucumber.utils.driver.SharedDriver  - Taking a screenshot
by augmenting the driver
2013-05-23 09:39:07,971 [main] DEBUG com.etrade.neo.appscucumber.utils.driver.SharedDriver
 - cannot forward the request Connection to http://10.96.46.13:5557 refused
Command duration or timeout: 9.31 seconds
Build info: version: '2.30.0', revision: 'dc1ef9ceb805a672f56dc49198f9ffbd4ca345c7',
time: '2013-02-19 09:14:38'
System info: os.name: 'Linux', os.arch: 'amd64', os.version: '2.6.18-194.32.1.el5',
java.version: '1.6.0_27'
Session ID: 14df52ce-d25c-4b60-a4ac-837d9421dc2e
Driver info: org.openqa.selenium.remote.RemoteWebDriver
Capabilities [{platform=XP, chrome.chromedriverVersion=26.0.1383.0, acceptSslCerts=false,
javascriptEnabled=true, browserName=chrome, rotatable=false, locationContextEnabled=false,
webdriver.remote.sessionid=14df52ce-d25c-4b60-a4ac-837d9421dc2e, version=26.0.1410.64,
cssSelectorsEnabled=true, databaseEnabled=false, handlesAlerts=true, browserConnectionEnabled=false,
nativeEvents=true, webStorageEnabled=true, applicationCacheEnabled=false, takesScreenshot=true}]
2013-05-23 09:39:08,059 [main] DEBUG com.etrade.neo.appscucumber.utils.driver.SharedDriver
 - [SharedDriver] Instantiated. 
)
        at org.apache.maven.surefire.booter.ProviderFactory.invokeProvider(ProviderFactory.java:87)
        at org.apache.maven.surefire.booter.ForkedBooter.runSuitesInProcess(ForkedBooter.java:153)
        at org.apache.maven.surefire.booter.ForkedBooter.main(ForkedBooter.java:95)
      Caused by: org.openqa.selenium.WebDriverException: findElement execution failed;
       Chrome did not respond to 'ExecuteJavascript'. Elapsed time was 1733573 ms.
(WARNING: The server did not provide any stacktrace information)
      Command duration or timeout: 1727.88 seconds

The third exception gives a hint as to why it waited this long:
      org.openqa.selenium.WebDriverException: Session [14df52ce-d25c-4b60-a4ac-837d9421dc2e]
was terminated due to FORWARDING_TO_NODE_FAILED
      Command duration or timeout: 83 milliseconds
      Build info: version: '2.30.0', revision: 'dc1ef9ceb805a672f56dc49198f9ffbd4ca345c7',
time: '2013-02-19 09:14:38'
      System info: os.name: 'Linux', os.arch: 'amd64', os.version: '2.6.18-194.32.1.el5',
java.version: '1.6.0_27'
      Session ID: 14df52ce-d25c-4b60-a4ac-837d9421dc2e
      Driver info: org.openqa.selenium.remote.RemoteWebDriver
      Capabilities [{platform=XP, chrome.chromedriverVersion=26.0.1383.0, acceptSslCerts=false,
javascriptEnabled=true, browserName=chrome, rotatable=false, locationContextEnabled=false,
webdriver.remote.sessionid=14df52ce-d25c-4b60-a4ac-837d9421dc2e, version=26.0.1410.64,
cssSelectorsEnabled=true, databaseEnabled=false, handlesAlerts=true, browserConnectionEnabled=false,
nativeEvents=true, webStorageEnabled=true, applicationCacheEnabled=false, takesScreenshot=true}]
        at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
        at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:39)
        at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27)
        at java.lang.reflect.Constructor.newInstance(Constructor.java:513)
        at org.openqa.selenium.remote.ErrorHandler.createThrowable(ErrorHandler.java:187)
        at org.openqa.selenium.remote.ErrorHandler.throwIfResponseFailed(ErrorHandler.java:145)
        at org.openqa.selenium.remote.RemoteWebDriver.execute(RemoteWebDriver.java:554)
        at org.openqa.selenium.remote.RemoteWebDriver.get(RemoteWebDriver.java:276)
        at sun.reflect.GeneratedMethodAccessor22.invoke(Unknown Source)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
        at java.lang.reflect.Method.invoke(Method.java:597)
        at org.openqa.selenium.support.events.EventFiringWebDriver$2.invoke(EventFiringWebDriver.java:101)
        at $Proxy7.get(Unknown Source)
        at org.openqa.selenium.support.events.EventFiringWebDriver.get(EventFiringWebDriver.java:155)

What steps will reproduce the problem?
1. Run test with WebDriverWait
2. Unknown? Shutdown selenium hub?
3. Profit

What is the expected output? What do you see instead?
I expect to see my wait time out after 5 seconds.  Instead, I saw my wait time out
after 1733 seconds

Selenium version: 2.29.0
OS: Windows 7
Browser: Chrome
Browser version:

Reported by Daniel.K.Winsor on 2013-05-23 18:13:51

lukeis commented 8 years ago
Hi!

As i can ses there are 2 issues:

1. currently waiting with N seconds, M iterations limits for operation X seconds long
leads to real waiting of X seconds if X > N.
Your expectation is that real waiting should be N seconds.

From my point selenium works as intendent. Please create new issue for implementing
new behaviour.

2. operation execution time in grid are limited by browserTimeout preference from grid/node
configuration [1]. If your node is down or selenium is crashed any operation could
take big amount of time.

For understanding is 1700+seconds is correct or not 
hub and node configuration is necessary.

[1] https://code.google.com/p/selenium/source/browse/java/server/src/org/openqa/grid/internal/TestSession.java#190

Reported by a.u.savchuk on 2013-07-22 19:05:02

lukeis commented 8 years ago
Closing the issue as there is no reproduction case provided. Feel free to ask for reopening
if it is still actual.

Reported by barancev on 2013-10-19 22:05:10

lukeis commented 8 years ago

Reported by luke.semerau on 2015-09-17 18:17:20