Bug 37334

Summary: [Qt] fast/frames/flattening/frameset-flattening-subframesets.html fails intermittently on Qt bot
Product: WebKit Reporter: Csaba Osztrogonác <ossy>
Component: Layout and RenderingAssignee: QtWebKit Unassigned <webkit-qt-unassigned>
Status: CLOSED FIXED    
Severity: Critical CC: abarth, eric, hausmann, jesus, kenneth, tonikitoo, webkit.review.bot
Priority: P1 Keywords: Qt
Version: 528+ (Nightly build)   
Hardware: PC   
OS: All   
Bug Depends on:    
Bug Blocks: 33297, 35784    
Attachments:
Description Flags
patch none

Comment 1 Kenneth Rohde Christiansen 2010-04-09 10:20:00 PDT
That new result is wrong, strange, I dont get this locally. It should be 900 and not 800, or it didnt do the flattening.
Comment 2 Csaba Osztrogonác 2010-04-09 10:38:22 PDT
(In reply to comment #1)
> That new result is wrong, strange, I dont get this locally. It should be 900
> and not 800, or it didnt do the flattening.

You misinterpreted, it is a flakey test. 
It passes usually, but sometimes we get this wrong result.
Comment 3 Kenneth Rohde Christiansen 2010-04-09 10:55:44 PDT
Is that also the case for the mac?
Comment 4 Csaba Osztrogonác 2010-04-10 00:53:28 PDT
(In reply to comment #3)
> Is that also the case for the mac?
I dont't know, I didn't see this fail on Mac bots before, but is is possible.
Comment 6 Eric Seidel (no email) 2010-04-14 10:45:23 PDT
Actually, failed twice in a row:
http://build.webkit.org/results/Qt%20Linux%20Release/r57584%20(10080)/fast/frames/flattening/iframe-flattening-offscreen-diffs.txt

Someone probably got a "you broke it" sheriff-bot email as a result. :(
Comment 7 Eric Seidel (no email) 2010-04-14 10:45:58 PDT
Nevermind, similar failure, different test.
Comment 8 Csaba Osztrogonác 2010-04-27 05:55:31 PDT
I'm worry because of this falkiness, because it occured 5 times during the last 20 builds. We should fix it asap not to block commit queue or put this test into skipped list.
Comment 9 Eric Seidel (no email) 2010-04-30 11:06:32 PDT
It's time to skip this test.   Too many false positives blocking the commit-queue and confusing folks looking at the bots.
Comment 10 Csaba Osztrogonác 2010-04-30 11:08:19 PDT
(In reply to comment #9)
> It's time to skip this test.   Too many false positives blocking the
> commit-queue and confusing folks looking at the bots.

I agree with you, I'll do it.
Comment 11 WebKit Review Bot 2010-04-30 12:28:57 PDT
http://trac.webkit.org/changeset/58588 might have broken Tiger Intel Release
The following changes are on the blame list:
http://trac.webkit.org/changeset/58587
http://trac.webkit.org/changeset/58588
Comment 12 Csaba Osztrogonác 2010-04-30 12:33:56 PDT
(In reply to comment #11)
> http://trac.webkit.org/changeset/58588 might have broken Tiger Intel Release
> The following changes are on the blame list:
> http://trac.webkit.org/changeset/58587
> http://trac.webkit.org/changeset/58588

58587 caused it, not me.
Comment 13 Csaba Osztrogonác 2010-04-30 12:35:41 PDT
I forgot to mention, that I skipped the test until fix.
http://trac.webkit.org/changeset/58588
Comment 14 Jesus Sanchez-Palencia 2010-05-03 10:19:48 PDT
I've just finish running this test. I did a 100,000 iterations round and then a 10 million one and I got no error at all. Not a single time...

I did this on an environment quite similar to the build bot (Debian Lenny, Qt 4.6, the package list provided by Ossy, etc) and I was going to debug it and try to fix, but without fails I can't be of any help. =/

I have no idea of what is causing the random crashes.
Comment 15 Jesus Sanchez-Palencia 2010-05-03 12:56:24 PDT
(In reply to comment #14)
> I've just finish running this test. I did a 100,000 iterations round and then a
> 10 million one and I got no error at all. Not a single time...
> 
> I did this on an environment quite similar to the build bot (Debian Lenny, Qt
> 4.6, the package list provided by Ossy, etc) and I was going to debug it and
> try to fix, but without fails I can't be of any help. =/
> 
> I have no idea of what is causing the random crashes.


After talking to Ossy I ran a new round of tests with "run-webkit-tests fast/frames/flattening --iterations 10000 --exit-after-n-failures 1"

And I had no failures again. I'll let it running a 1 million iterations round during the night...
Comment 16 Antonio Gomes 2010-05-03 13:01:06 PDT
> After talking to Ossy I ran a new round of tests with "run-webkit-tests
> fast/frames/flattening --iterations 10000 --exit-after-n-failures 1"
> 
> And I had no failures again. I'll let it running a 1 million iterations round
> during the night...

jesus, if it is a sideeffect of any other test, you wont catch it by running this test alone repeatedly. How are you running?

Maybe running some tests (folders) that are known to be ran before it, so it can trigger the bad effect(?)
Comment 17 Csaba Osztrogonác 2010-05-03 13:35:56 PDT
Hooray, I catched the bug. :))

layoutTestController.display() in fast/frames/flattening/frameset-flattening-subframesets.html is the culprit.

layoutTestController.display() needs communication with the X server,
and I think this delay might cause failing sometimes. (If I increased
the nice value of X server, fail occured more often.)

I commented layoutTestController.display() in fast/frames/flattening/frameset-flattening-subframesets.html, and it works correctly, without any fail. I ran
fast/frames/flattening tests with--iterations 10000 option. Do we need
display() for this test? Or can we simple remove it from the test case?
Comment 18 Csaba Osztrogonác 2010-05-03 15:47:56 PDT
(In reply to comment #17)
> Hooray, I catched the bug. :))
I meant fast/frames/flattening/frameset-flattening-subframe-resize.html is the culprit.

fast/frames/flattening/frameset-flattening-subframe-resize.html skipped until fix: http://trac.webkit.org/changeset/58711
Comment 19 Kenneth Rohde Christiansen 2010-05-07 06:07:01 PDT
(In reply to comment #18)
> (In reply to comment #17)
> > Hooray, I catched the bug. :))
> I meant fast/frames/flattening/frameset-flattening-subframe-resize.html is the
> culprit.
> 
> fast/frames/flattening/frameset-flattening-subframe-resize.html skipped until
> fix: http://trac.webkit.org/changeset/58711

I think I raed you fixed this one by removing the call to display()? Can we close if that is right?
Comment 20 Csaba Osztrogonác 2010-05-07 06:10:28 PDT
(In reply to comment #19)
> I think I raed you fixed this one by removing the call to display()? Can we
> close if that is right?
I asked, because I'm not sure if removing the call to display is the correct solution. It works for me locally, but is it correct? If it's OK, we can remove it, and unskip fast/frames/flattening/frameset-flattening-subframe-resize.html and then close the bug.
Comment 21 Kenneth Rohde Christiansen 2010-05-07 06:18:15 PDT
display was used to force the layout, but it seems that it is not needed, so it should be OK to remove. At least I think it is worth a try.
Comment 22 Antonio Gomes 2010-05-07 06:53:28 PDT
(In reply to comment #21)
> display was used to force the layout, but it seems that it is not needed, so it
> should be OK to remove. At least I think it is worth a try.

there are many other ways to "force a layout" used throughout LayoutTests/*

document.body.offsetTop

... is one of the common ones.

$ grep -nHR layout LayoutTests/ --include=*.html | grep -i force

maybe switching "LayoutTestController.display()" in favor of one of them?
Comment 23 Kenneth Rohde Christiansen 2010-05-07 06:55:58 PDT
(In reply to comment #22)
> (In reply to comment #21)
> > display was used to force the layout, but it seems that it is not needed, so it
> > should be OK to remove. At least I think it is worth a try.
> 
> there are many other ways to "force a layout" used throughout LayoutTests/*
> 
> document.body.offsetTop
> 
> ... is one of the common ones.
> 
> $ grep -nHR layout LayoutTests/ --include=*.html | grep -i force
> 
> maybe switching "LayoutTestController.display()" in favor of one of them?

document.body.offsetTop is already called, that invalidates the layout, but doesn't necessarily to a relayout, which is only done on paint.
Comment 24 Eric Seidel (no email) 2010-05-07 08:42:14 PDT
(In reply to comment #23)
> document.body.offsetTop is already called, that invalidates the layout, but
> doesn't necessarily to a relayout, which is only done on paint.

That's not correct.  Accessing many javascript properties, including document.body.offsetTop will guarantee that a layout (and thus also a style resolve) has completed.

We should not be using .display() for ensuring layout.  It's used for ensuring paint for for testing specific paint bugs.

That said, if .display() is broken on these bots, then other tests will break.
Comment 25 Kenneth Rohde Christiansen 2010-05-07 10:18:50 PDT
(In reply to comment #24)
> (In reply to comment #23)
> > document.body.offsetTop is already called, that invalidates the layout, but
> > doesn't necessarily to a relayout, which is only done on paint.
> 
> That's not correct.  Accessing many javascript properties, including
> document.body.offsetTop will guarantee that a layout (and thus also a style
> resolve) has completed.
> 
> We should not be using .display() for ensuring layout.  It's used for ensuring
> paint for for testing specific paint bugs.
> 
> That said, if .display() is broken on these bots, then other tests will break.

Doesn't it just result in a call to setNeedsLayout(), thus marking a layout? Qt calls layoutIfNeeded() during paint. If you are right, that is great, because then we can just remove the display() call, but as you said, that won't fix other tests using display().
Comment 26 Antonio Gomes 2010-05-11 12:50:40 PDT
Created attachment 55740 [details]
patch

Committed r59165: <http://trac.webkit.org/changeset/59165>
Comment 27 Antonio Gomes 2010-05-11 12:51:23 PDT
I uploded the patch to make cherry-picking easier
Comment 29 Simon Hausmann 2010-05-12 00:50:22 PDT
Revision r59165 cherry-picked into qtwebkit-2.0 with commit 79d424c6674d65561b1d926d04b9c8c52fd51384