Bug 134550 - Layout Test http/tests/cache/iframe-304-crash.html is flaky on GTK and Mac WebKit2 platforms
Summary: Layout Test http/tests/cache/iframe-304-crash.html is flaky on GTK and Mac We...
Status: NEW
Alias: None
Product: WebKit
Classification: Unclassified
Component: Tools / Tests (show other bugs)
Version: 528+ (Nightly build)
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Nobody
URL: http://build.webkit.org/results/Apple...
Keywords:
Depends on:
Blocks:
 
Reported: 2014-07-02 11:08 PDT by Carlos Alberto Lopez Perez
Modified: 2015-09-06 23:08 PDT (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Carlos Alberto Lopez Perez 2014-07-02 11:08:37 PDT
The layout test http/tests/cache/iframe-304-crash.html is flaky on WebKit2 platforms (checked on the flakiness dashboard, both Apple Mavericks and GTK have random recent failures):

The diff is the following: http://build.webkit.org/results/Apple%20Mavericks%20Debug%20WK2%20%28Tests%29/r170423%20%285407%29/http/tests/cache/iframe-304-crash-pretty-diff.html

Probable cause:

Sometimes the event didFinishLoading for the newIframe inserted with document.body.appendChild don't happens (or happens after testRunner.notifyDone).

The following _bash_ command should be able to reproduce the failure in less than 100 iterations:

WebKit $ rm -fr layout-test-results; n=0; while ! test -f layout-test-results/http/tests/cache/iframe-304-crash-diff.txt; do Tools/Scripts/run-webkit-tests --no-show-results --no-new-test-results --no-sample-on-timeout --results-directory layout-test-results --debug-rwt-logging --release --webkit-test-runner --gtk --no-retry-failures http/tests/cache/cached-main-resource.html http/tests/cache/iframe-304-crash.html; n=$(( ${n} + 1 )); done
# In the above command replace "--gtk" with your port name (if you are not running the GTK port)
WebKit $ echo "Test failed after ${n} iters"
WebKit $ cat layout-test-results/http/tests/cache/iframe-304-crash-diff.txt


I tested the following patch:

--- a/LayoutTests/http/tests/cache/iframe-304-crash.html
+++ b/LayoutTests/http/tests/cache/iframe-304-crash.html
@@ -11,7 +11,7 @@ function removeAndReplaceIframe() {
     document.body.removeChild(document.getElementById("iframe"));
     var newIframe = document.createElement("iframe");
     newIframe.src = "resources/iframe304.php";
-    newIframe.onload = function() { setTimeout(finish, 0); }
+    newIframe.onload = function() { setTimeout(finish, 100); }
     document.body.appendChild(newIframe);
 }
 

And with it I'm not longer able to reproduce the failure. However I'm afraid that this would only workaround the issue (just wait 100ms more) but won't fix the underlying problem.