question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Timeout set to 10 minutes, but timing out after 3 minutes

See original GitHub issue

🐛 Bug Report

I am setting the timeout to 10 minutes because I am using https://github.com/scrapinghub/crawlera-headless-proxy

I am seeing it timeout after 3 minutes (still downloading all of the JS/CSS files)

To Reproduce

Set page load timeout to 10 minutes

Expected behavior

Expecting it to timeout after 10 minutes, not 3.

Test script or set of commands reproducing this issue

driver.manage().timeouts().pageLoadTimeout(Duration.ofMillis(600000));
driver.manage().timeouts().setScriptTimeout(Duration.ofMillis(600000));

try {
driver.get(uRL.toExternalForm());
} catch (TimeoutException te2) {
log.warn("Chrome Driver thread timed out: " + uRL.toExternalForm());
}

Environment

OS: Windows Browser: Chrome Browser version: Version 89.0.4389.90 (Official Build) (64-bit) Browser Driver version: ChromeDriver 89.0.4389.23 Language Bindings version: Java 8 Selenium Grid version (if applicable): Beta 2

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:26 (11 by maintainers)

github_iconTop GitHub Comments

1reaction
githubuser100007commented, Mar 30, 2021

An early timeout is not the problem. It’s when you set it to 10 minutes that is the problem.

I’m wondering if the chromedriver doesn’t support changing its timeouts, so anything earlier than it’s default of 3 minutes is okay but anything after 3 minutes the chrome driver times out no matter what at 3 minutes.

0reactions
pujaganicommented, May 12, 2021

Thank you for the feedback and the details. Probably this will help, quit the RemoteWebDriver then close the ChromeDriver service. I stepped through the code to confirm that RemoteWebDriver quit will not close the ChromeDriver service. Thanks for bringing this to our notice.

public class SetTimeout {

    ChromeDriverService chromeDriverService;

    public static void main(String[] args) throws Exception {

        SetTimeout setTimeout = new SetTimeout();

        RemoteWebDriver driver = setTimeout.createDriver();

        long timer = System.currentTimeMillis();
        try {
            driver.get("https://www.walmart.com/");
            System.out.println(driver.getTitle());
        } catch (TimeoutException te2) {
            System.out.println("Chrome Driver thread timed out: " + (System.currentTimeMillis() - timer)); // prints approximately 3 minutes, no matter what
        } finally {
            driver.quit();
            setTimeout.getChromeDriverService().stop();
        }

    }

    public ChromeDriverService getChromeDriverService() {
        return chromeDriverService;
    }


    private RemoteWebDriver createDriver() throws Exception {

        RemoteWebDriver driver = null;

        ChromeOptions options = new ChromeOptions();

        //remove unexepectedalertexceptions
        options.addArguments("--unexpectedAlertBehaviour=dismiss", "--silent", "--blink-settings=imagesEnabled=false", "--disable-blink-features", "--disable-blink-features=AutomationControlled", "--disable-gpu", "--no-sandbox", "--window-size=1920,1200", "--ignore-certificate-errors", "--disable-application-cache");

        // no downloads
        Map<String, Object> chromePrefs = new HashMap<String, Object>();
        chromePrefs.put("download_restrictions", 3);
        options.setExperimentalOption("prefs", chromePrefs);

        LoggingPreferences logPrefs = new LoggingPreferences();
        logPrefs.enable(LogType.PERFORMANCE, Level.ALL);
        options.setCapability("goog:loggingPrefs", logPrefs);
        options.setPageLoadStrategy(PageLoadStrategy.EAGER);


        DriverService.Builder serviceBuilder = new ChromeDriverService.Builder();
        chromeDriverService = (ChromeDriverService) serviceBuilder.build();
        chromeDriverService.sendOutputTo(new FileOutputStream("/dev/null"));
        chromeDriverService.start();

// Rest of the code is same as shared earlier
Read more comments on GitHub >

github_iconTop Results From Across the Web

Screen timeout after 3 minutes - Microsoft Community
I recently updated Windows 10 and the screen is turning off after 3 minutes of inactivity despite my screen timeout settings set for...
Read more >
Screen timeout won't change from 10 minutes
After the last update, my screen timeout is aet to 10 minutes. I changed it to 1 minute , but it wont change...
Read more >
Can't have a timeout of over 2 minutes with this.http.get?
I was using the proxy config, and the proxy's default timeout is 120 seconds (2 minutes). If that's your case, you just need...
Read more >
Pipeline timeout after setting timeout=0 - Visual Studio Feedback
It looks like a default timeout of 10 minutes, you can also retrieve this error message from the network to further check the...
Read more >
Extending the default timeout periods for vCenter Server, ESX ...
To resolve this issue, you can increase the vCenter Server and ESXi/ESX host timeout values. Three hours (10800 seconds) is generally sufficient ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found