Skip to end of metadata
Go to start of metadata

Description

You'll see this error when Sauce Labs doesn't receive a new command from your Selenium script in more than 90 seconds (the default duration for a timeout).

Cause

There are a couple potential causes for this error.

  • The most common cause is that your script crashed, was forcefully interrupted, or you lost internet connectivity
  • If your tests don't include a session ending request, such as a call to driver.quit() or browser.stop(), they will will keep running forever, consuming all test minutes available in your account. This error is thrown after 90 seconds as a means of preventing this. 
  • A less common, but still possible cause, is that your test legitimately needs more than 90 seconds to send a new command to the browser. This happens most often when a network or disk IO error occurs between Selenium API calls in your tests (for example, for DB queries, local file reads, or changes).

How to Resolve

  • Make sure you have internet connectivity
  • Make sure your script includes driver.quit() or browser.stop() to conclude the test
  • If your test needs more than 90 seconds to send a new command to the browser, use the idleTimeout desired capability to modify Sauce's wait time for further commands. You can find out more about this desired capability in the Timeouts section of the Test Configuration Options topic.
  • No labels

1 Comment

  1. Specific

    Cause

    It might be worth making a distinction between sessions being "Abandoned" & sessions requiring longer to run?

    Add that non-threadsafe (or perhaps the term is badly parallelised?) code can also cause sessions to become "abandoned"; I'd say this is almost or maybe more common for larger & new customers.

    How to Resolve

    Often customers have "driver.quit" but in case of error, it gets skipped because the test aborts immediately.  Maybe we can clarify that as:

    Make sure your code always calls driver.quit() for every session it opens, including during tests that fail.

    If a test failure causes your test framework to abort all running tests immediately, make sure all sessions still receive a call to 'quit'.

    This can often be done by putting test cleanup in an action ran after each or all tests, or by wrapping driver-controlled code in a BEGIN-RESCUE-END structure, but I don't know how to put that succinctly.

    There's another failure case I'm also not sure how to describe; Badly parallelised tests.  Some customers have frameworks that just abandon some tests once done, or which overwrite one driver with another (leaving the first 'abandoned').  Those are often also the customers who aren't sure how to debug this and there isn't really a good, prescriptive resolution; It's basically limited to "Don't have crap parallelisation".

    We consider a longer idleTimeout to be bad practise because most of the time it's just not needed or it's a sign of a badly constructed test framework.  Maybe it should come with a warning or at least a subtle push (That you're billed for total test runtime, whether you're sending commands or not)

    General

    Is there some way to remove '90' from the title but still convey that it's some number of seconds?  That number will reflect the actual idleTimeout duration.r

    Maybe we should do this in the description as well:

    You'll see this error when Sauce Labs doesn't receive a new command from your Selenium script for more then the value of idleTimeout (By default, 90 seconds)