Bug 32319 - Make changing-frame-hierarchy-in-onload.html non-flaky and platform-independent
Summary: Make changing-frame-hierarchy-in-onload.html non-flaky and platform-independent
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: Tools / Tests (show other bugs)
Version: 528+ (Nightly build)
Hardware: PC OS X 10.5
: P2 Minor
Assignee: Nobody
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2009-12-09 05:26 PST by Kinuko Yasuda
Modified: 2009-12-14 14:16 PST (History)
1 user (show)

See Also:


Attachments
Make changing-frame-hierarchy-in-onload.html less flaky (1.56 KB, patch)
2009-12-09 05:39 PST, Kinuko Yasuda
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Kinuko Yasuda 2009-12-09 05:26:12 PST
The layout test changing-frame-hierarchy-in-onload.html can be flaky or can yield different results across different platforms.

The potential flakiness comes from the timing issue around setTimer and iframe loading.   If I understand correctly, the test expects stop() is called:
1) after all the HTML elements in the main page are loaded
2) before body's onload() is called, and
3) before any iframe contents are shown (i.e. expects empty iframe content). 

1) and 2) are almost always met, but 3) can cause some problems especially on other platforms than Mac/WebKit.
On Mac/Webkit loading resources/slow-resource.pl doesn't render anything until all the data from the script is loaded due to buffering in NSURLConnection.   The script returns one line text first, sleeps 5 sec and returns another line, therefore on Mac/Webkit it's safe to assume iframe content is empty for 5 sec or so.   However this does not apply on some other platforms - for example on {Mac,Linux,Win}/Chrome this test always (on Mac,Linux) or often (on Windows) fails because they render the iframe contents as soon as they receive any data.  (corresponding bug: http://code.google.com/p/chromium/issues/detail?id=24206)
Comment 1 Kinuko Yasuda 2009-12-09 05:39:03 PST
Created attachment 44531 [details]
Make changing-frame-hierarchy-in-onload.html less flaky
Comment 2 Kinuko Yasuda 2009-12-09 05:41:56 PST
Attached a proposing patch.  I've tested the test crashes without the fix made for the original issue 16102.
Comment 3 Darin Fisher (:fishd, Google) 2009-12-09 09:14:27 PST
Comment on attachment 44531 [details]
Make changing-frame-hierarchy-in-onload.html less flaky

I guess a more direct solution would have been to use a variant of slow-resource.pl
that doesn't print out anything until after the 5 second timeout has elapsed.

I assume you made the other changes in an effort to speed up the test.  Is that right?

R=me
Comment 4 Kinuko Yasuda 2009-12-09 20:53:23 PST
(In reply to comment #3)
> (From update of attachment 44531 [details])
> I guess a more direct solution would have been to use a variant of
> slow-resource.pl
> that doesn't print out anything until after the 5 second timeout has elapsed.
> 
> I assume you made the other changes in an effort to speed up the test.  Is that
> right?
> 
> R=me

Thanks for reviewing,
the patch also includes the part replacing slow-resource.pl with its variant, slow-resource-1-sec.pl, which doesn't print out anything until after the 1 sec timeout has elapsed.
Comment 5 WebKit Commit Bot 2009-12-14 14:16:40 PST
Comment on attachment 44531 [details]
Make changing-frame-hierarchy-in-onload.html less flaky

Clearing flags on attachment: 44531

Committed r52119: <http://trac.webkit.org/changeset/52119>
Comment 6 WebKit Commit Bot 2009-12-14 14:16:44 PST
All reviewed patches have been landed.  Closing bug.