New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

browserTimeout parameter and BROWSER_TIMEOUT reason are confusing and inconsistent #6370

Closed
kool79 opened this Issue Sep 5, 2018 · 4 comments

Comments

Projects
None yet
3 participants
@kool79

kool79 commented Sep 5, 2018

  1. Parameter browserTimeout does nothing (actually not used).
    The last time it was used is pre-3.9 version in java/server/src/org/openqa/selenium/remote/server/DriverServlet.java, (file deleted in commit 0811736)
    Currently both OKHttp and Apache use timeout with duration==3 hours which sometimes hangs test (for example, when Authentication required but not provided or when broconnection interrupted/died) (Thats why test BrowserTimeOutTest is broken)

  2. Hub continues to return error codes with message "Session [...] was terminated due to BROWSER_TIMEOUT" which is confusing and has nothing common with browserTimeout parameter. Currently this error reason is returned by hub to clients (tests) after remote node returns 404 error - 'no such session', See TestSession#closeSessionIfNecessary lines 301, 323, 330
    But behavior is specific - During first request (after session is gone) client gets error "no such session" (proxied by hub) but all subsequent requests return error "browser_timeout":

 someCode();
 // here session lost on node. 
// (for ex., by newCommandTimeout or due --sessionOverride in appium)
 try{
   wd.findElement().getText()  // try to get title:  "no such session"
} catch (WebDriverException e){
  wd.getScreenshot()      // try to make screenshot: "browser timeout"      
}

Of cause wrong reason is not so critical issue but it significantly complicates process of grid environment configuration, logs analysing, investigation of error reasond etc.

Proposed fix for item 1: when initialise proxy httpClient use browserTimeout parameter to instead of using default constant value (3h) for apache and okhttp clients

Proposed fix for item 2:

  • use "BROWSER_TIMEOUT" reson only together with browserTimeout parameter (number of seconds a browser session is allowed to hang while a WebDriver command is running (example: driver.get(url)))
  • if required add another session termination reason, for example SessionTerminationReason.INVALID_SESSION_ID

@diemol diemol added the C-grid label Sep 5, 2018

@kool79

This comment has been minimized.

Show comment
Hide comment
@kool79

kool79 Sep 5, 2018

Forgot to mention: grid v3.14.0,
Maybe it is the reason for the #5661, #4454, #4508

kool79 commented Sep 5, 2018

Forgot to mention: grid v3.14.0,
Maybe it is the reason for the #5661, #4454, #4508

@diemol

This comment has been minimized.

Show comment
Hide comment
@diemol

diemol Sep 14, 2018

Member

Hi @kool79,

Yes, browserTimeout was not being used in recent versions of Selenium Grid, this has been fixed through these changes and it will be available in the next release.

Member

diemol commented Sep 14, 2018

Hi @kool79,

Yes, browserTimeout was not being used in recent versions of Selenium Grid, this has been fixed through these changes and it will be available in the next release.

@diemol diemol closed this Sep 14, 2018

@oleksandr-kulychok

This comment has been minimized.

Show comment
Hide comment
@oleksandr-kulychok

oleksandr-kulychok Sep 14, 2018

@diemol ,
What about 2nd part of issue :

Hub continues to return error codes with message "Session [...] was terminated due to BROWSER_TIMEOUT" which is confusing and has nothing common with browserTimeout parameter. Currently this error reason is returned by hub to clients (tests) after remote node returns 404 error - 'no such session', See TestSession#closeSessionIfNecessary lines 301, 323, 330

I.e. clients (tests) get wrong exceptions that "session terminated due to browser_timeout" but in fact it is not the case. Due that behavior it is very hard to understand the real rootcause of issue and can be confusing both for test automation engineers and for Selenium support team.

oleksandr-kulychok commented Sep 14, 2018

@diemol ,
What about 2nd part of issue :

Hub continues to return error codes with message "Session [...] was terminated due to BROWSER_TIMEOUT" which is confusing and has nothing common with browserTimeout parameter. Currently this error reason is returned by hub to clients (tests) after remote node returns 404 error - 'no such session', See TestSession#closeSessionIfNecessary lines 301, 323, 330

I.e. clients (tests) get wrong exceptions that "session terminated due to browser_timeout" but in fact it is not the case. Due that behavior it is very hard to understand the real rootcause of issue and can be confusing both for test automation engineers and for Selenium support team.

@diemol

This comment has been minimized.

Show comment
Hide comment
@diemol

diemol Sep 15, 2018

Member

clients (tests) get wrong exceptions that "session terminated due to browser_timeout" but in fact it is not the case

Why do you say that? Do you have an example where that is not the case? (Also take into account that browserTimeout is broken right now, so this is probably a cascade of wrong exceptions due to that).

Member

diemol commented Sep 15, 2018

clients (tests) get wrong exceptions that "session terminated due to browser_timeout" but in fact it is not the case

Why do you say that? Do you have an example where that is not the case? (Also take into account that browserTimeout is broken right now, so this is probably a cascade of wrong exceptions due to that).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment