selenium icon indicating copy to clipboard operation
selenium copied to clipboard

Selenium Grid 2.49.0 throwing Timeout's (Session [d3e1b70c-4a81-4a1c-8916-b050106da3d9] was terminated due to TIMEOUT)

Open smccarthy opened this issue 10 years ago • 18 comments

Windows 7 VM has the hub and the node.

Test :

import java.net.URL;
import java.util.concurrent.TimeUnit;
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.remote.DesiredCapabilities;
import org.openqa.selenium.remote.RemoteWebDriver;
import org.testng.annotations.Test;

public class TestSeleniumGrid249 {
    @Test
    public void testSeleniumGrid249() throws Exception {
        DesiredCapabilities capabilities = DesiredCapabilities.chrome();
        WebDriver driver = new RemoteWebDriver(new URL("http://172.27.1.146:4444/wd/hub"), capabilities);
        Thread.sleep(5000);
        driver.manage().timeouts().setScriptTimeout(10, TimeUnit.SECONDS); // fails here
    }
}

Start Node: java -Dwebdriver.ie.driver=\tmp\webdriver\iedriver\iedriver_2.48.0_Win32bit.exe -Dwebdriver.chrome.driver=\tmp\webdriver\chromedriver\chromedriver_2.20_32bit.exe -jar C:\tmp\webdriver\2.49.0.jar -role wd -nodeConfig node_5555_1.json

Start Hub: java -jar C:\tmp\webdriver\2.49.0.jar -role hub -hubConfig hub_4444_1.json

Hub Json:

{
  "port": 4444,
  "newSessionWaitTimeout": 25000,
  "nodePolling": 5000,
  "cleanUpCycle": 5000,
  "browserTimeout": 120000,
  "timeout": 120000,
  "maxSession": 5
}

Node Json:

{
  "capabilities": [
    {
      "seleniumProtocol": "WebDriver",
      "browserName": "internet explorer",
      "maxInstances": 1,
      "version": "11"
    },
    {
      "seleniumProtocol": "WebDriver",
      "browserName": "chrome",
      "maxInstances": 3,
      "version": "47"
    },
    {
      "seleniumProtocol": "WebDriver",
      "browserName": "firefox",
      "maxInstances": 3
    }
  ],
  "configuration": {
    "maxSession": 3,
    "port": 5555,
    "hubPort": 4444,
    "hubHost": "127.0.0.1"
  }
}

smccarthy avatar Jan 18 '16 21:01 smccarthy

Sorry I forgot to mention, it fails on Chrome, Firefox, and IE11 for me on Windows 7. It worked with the 2.48.2 jar file.

smccarthy avatar Jan 18 '16 21:01 smccarthy

I also tried the exact same script on OSX (with Firefox) and it failed the same way.

Edit : I did notice increasing the cleanUpCycle in my hub config did make this specific test case pass.

smccarthy avatar Jan 18 '16 21:01 smccarthy

I had the same issue earlier with VMs on a selenium grid. Removing the Thread.Sleep from my test fixed it for me.

BenChand avatar Jan 18 '16 22:01 BenChand

@BenChand I wanted my test to take longer than 5 seconds. That is why I used Thread.sleep(5000);

smccarthy avatar Jan 18 '16 23:01 smccarthy

@smccarthy Maybe try a driver wait with a timeout and catch the exception it will throw. At least the selenium session will know you are pausing it for a reason that way.

BenChand avatar Jan 18 '16 23:01 BenChand

Same problem here: I'm using https://github.com/codeborne/selenide and it waits for ajax requests ... With 2.48.2. everything worked fine and with 2.49 i'm getting: "was terminated due to TIMEOUT".

hablijack avatar Jan 19 '16 05:01 hablijack

We run into it in a test where we are waiting for an email to arrive and refresh the page every 5 seconds to check if it is there. We reduced the sleep but even at 3 seconds it happens on occasion. Seemingly, if the interval poller pings during a sleep/wait - it reports back that the browser session is dead and terminates the connection.

its not clear if this is a feature which was broken in previous releases, or a bug newly introduced in .49 The timeout logic itself makes sense, would be interesting to understand why the same failures do not occur in .48

azohra avatar Jan 19 '16 16:01 azohra

Fixed by 545fba4d6c02645e1530d97a3c20bda74631a180

barancev avatar Jan 19 '16 21:01 barancev

all hail @barancev !! cheers mate.

azohra avatar Jan 19 '16 21:01 azohra

The fixed version 2.49.1 is available for download

barancev avatar Jan 21 '16 17:01 barancev

cool, thanks for the fix

foxrafi avatar Jan 21 '16 19:01 foxrafi

only one commit is showing in 2.49.1 and it appears related to python specifically. Just an issue in the documentation?

azohra avatar Jan 21 '16 20:01 azohra

@tk8817 what specifically are you looking at? can you send me a link

lukeis avatar Jan 21 '16 21:01 lukeis

I have the same problem with java. also with 2.49.1.

benzman81 avatar Jan 22 '16 16:01 benzman81

@lukeis , check the commit history for 2.49.1, its just a single line fix related to python. as per @benzman81 , the issue persists in this version as well.

The fix commited by @barancev does not appear to be in 2.49.1

azohra avatar Jan 22 '16 17:01 azohra

@tk8817 what are you looking at??

https://github.com/SeleniumHQ/selenium/commits/selenium-2.49.1

545fba4d6c02645e1530d97a3c20bda74631a180 is clearly shown in the history

lukeis avatar Jan 22 '16 18:01 lukeis

Just wanted to add, that I am using Selenium Grid extras with driver auto update. The timeout issue appears since v2.49 and seems not to be fixed with v2.49.1, at least in our virtual machines with grid extras.

benzman81 avatar Jan 22 '16 18:01 benzman81

@benzman81 This looks fixed. I verified it with the selenium standalone jar (2.49.1), using the configs I posted in the opening post. Please take your concerns to the Selenium-Grid-Extras issue list if you are using Selenium-Grid-Extras. We can continue the discussion/debugging there.

smccarthy avatar Jan 23 '16 05:01 smccarthy