ericmckean / chromedriver

Automatically exported from code.google.com/p/chromedriver
0 stars 0 forks source link

Android Tablet: flakiness after navigating to never loading page #1061

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
PageLoadingTest testShouldTimeoutIfAPageTakesTooLongToLoad is flaky on Android 
Tablets but never on Android Phones (I have not tried it in 'show desktop site' 
mode on a phone).

What the test does is it:
- driver.manage().timeouts().pageLoadTimeout(2, SECONDS);
- navigates to a page that takes a long time to load (5 seconds is as good as 
forever in that scenario)
- asserts that TimeoutException comes soon after 2 seconds (that passes)
- then while the slow page still loads (and chrome waits for it although 
chromedriver doesn't), it navigates to another page

Flakiness is ~10% in the case when the emulator is running on one machine with 
the test and the HTTP test file server (so latencies between the test, all 
chromedriver components and HTTP server are small).

There are two modes of failure, they reproduce about 5% of the time each:
1) driver.get(pages.xhtmlTestPage) times out with either
org.openqa.selenium.TimeoutException: timeout: Timed out receiving message from 
renderer: 2.000
or something slightly smaller than 2.000, e.g.
org.openqa.selenium.TimeoutException: timeout: Timed out receiving message from 
renderer: 1.920

2) driver.get(pages.xhtmlTestPage) does NOT time out, but takes more than two 
seconds and so assertThat(duration, lessThan(2000)) in the end of the test 
fails.

Original issue reported on code.google.com by vlotoshn...@gmail.com on 19 Mar 2015 at 12:01

GoogleCodeExporter commented 9 years ago
After more investigation, it turns out the flakiness is caused by the test 
being time sensitive. Not a chromedriver issue.

It fails when the machine that runs the test and emulator is slow enough.
https://github.com/SeleniumHQ/selenium/commit/77c7c9289ce3f7a21c018b9281b1835d36
a29206 made that test less flaky. 

Original comment by vlotoshn...@gmail.com on 26 Mar 2015 at 7:30