Closed Bug 513146 Opened 15 years ago Closed 14 years ago

mochitest-plain: test_domWindowUtils.html fails intermittently

Categories

(Core :: DOM: Core & HTML, defect)

defect
Not set
minor

Tracking

()

RESOLVED FIXED
mozilla1.9.3a2
Tracking Status
status1.9.2 --- .2-fixed
status1.9.1 --- .9-fixed

People

(Reporter: sgautherie, Assigned: bzbarsky)

References

()

Details

(Keywords: intermittent-failure)

Attachments

(1 file)

http://tinderbox.mozilla.org/showlog.cgi?log=Firefox3.5/1251411556.1251418059.10690.gz
Linux mozilla-1.9.1 unit test on 2009/08/27 15:19:16
{
... | at index 0 for data [0, 100] - got null, expected [object HTMLDivElement]
... | at index 1 for data [9, 109] - got null, expected [object HTMLDivElement]
... | at index 4 for data [0, 100, true, false] - got null, expected [object HTMLDivElement]
... | at index 5 for data [9, 109, true, false] - got null, expected [object HTMLDivElement]
... | at index 6 for data [0, 100000, true, false] - got null, expected [object HTMLDivElement]
... | at index 7 for data [9, 100009, true, false] - got null, expected [object HTMLDivElement]
}
Blocks: 438871
Whiteboard: [orange]
http://tinderbox.mozilla.org/showlog.cgi?log=Firefox/1266601481.1266602103.10239.gz
OS X 10.5.2 mozilla-central opt test mochitests-3/5 on 2010/02/19 09:44:41  
s: bm-xserve17
http://tinderbox.mozilla.org/showlog.cgi?log=Firefox/1266602287.1266604723.18310.gz
WINNT 5.2 mozilla-central debug test mochitests-3/5 on 2010/02/19 09:58:07  
s: win32-slave18
OS X 10.5.2 mozilla-central opt test mochitests-3/5 [testfailed] Started 11:23, finished 11:36
http://tinderbox.mozilla.org/showlog.cgi?log=Firefox/1266607388.1266608141.31755.gz
Linux mozilla-central opt test mochitests-3/5 [testfailed] Started 11:29, finished 11:47
http://tinderbox.mozilla.org/showlog.cgi?log=Firefox/1266607768.1266608765.1650.gz
OS X 10.5.2 mozilla-central opt test mochitests-3/5 [testfailed] Started 11:56, finished 12:12

http://tinderbox.mozilla.org/showlog.cgi?log=Firefox/1266609416.1266610318.6170.gz
WINNT 5.2 mozilla-central opt test mochitests-3/5 [testfailed] Started 12:09, finished 12:21
http://tinderbox.mozilla.org/showlog.cgi?log=Firefox/1266601481.1266602103.10239.gz
WINNT 5.2 mozilla-central debug test mochitests-3/5 [testfailed] Started 13:56, finished 14:34
http://tinderbox.mozilla.org/showlog.cgi?log=Firefox/1266616575.1266618835.2312.gz
http://tinderbox.mozilla.org/showlog.cgi?log=Firefox/1266617159.1266619251.3656.gz

WINNT 5.2 mozilla-central debug test mochitests-3/5 [testfailed] Started 14:05, finished 14:41
OS X 10.5.2 mozilla-central opt test mochitests-3/5 [testfailed] Started 14:44, finished 14:53

http://tinderbox.mozilla.org/showlog.cgi?log=Firefox/1266619455.1266619967.6279.gz
OS X 10.5.2 mozilla-central opt test mochitests-3/5 [testfailed] Started 17:48, finished 17:58

http://tinderbox.mozilla.org/showlog.cgi?log=Firefox/1266630528.1266631064.8888.gz
http://tinderbox.mozilla.org/showlog.cgi?log=Firefox/1266631570.1266632012.11393.gz
Linux mozilla-central opt test mochitests-3/5 on 2010/02/19 18:06:10
s: moz2-linux-slave21
This test went perma-orange today when I checked in reflows off refresh driver.

The reason for this (and for the previous failures) is that the test structure is basically like this:

  <link rel="stylesheet" href="something">
  <!-- some other stuff -->
  <div style="position it somewhere">
  <script>
    function f() {
      // rely on the div being positioned at the right somewhere without
      // flushing layout first
    }
    f();
  </script>

If the script runs before the <div> has been initially laid out, the test fails.  The only reason it sometimes passed before is that we sometimes parsed the <div> before the stylesheet had finished loading.  When we then parsed the <script>, it blocked on the stylesheet load, went back out to the event loop, and we processed the div layout before the script executed.  If the race went the other way, so the sheet loaded before we parsed the <div>, then the test failed.

With reflow off refresh driver, we started failing unless we ended up hanging out in the event loop waiting for the sheet load for more than 20ms or so.  Which was most of the time.

The fix is simple: just don't run the test function until onload, at which point the layout should be up-to-date.  The other option (which doesn't rely on that onload behavior, in case we ever want to switch to the cheating Webkit way) is an explicit flush at the start of the test function.  Gavin, let me know if you'd prefer that.
Assignee: nobody → bzbarsky
Status: NEW → ASSIGNED
Attachment #427903 - Flags: review?(gavin.sharp)
(In reply to comment #15)
> Created an attachment (id=427903) [details]
> The fix I just pushed

http://hg.mozilla.org/mozilla-central/rev/1d2b78587a8a
status1.9.1: --- → ?
status1.9.2: --- → ?
Version: 1.9.1 Branch → Trunk
Comment on attachment 427903 [details] [diff] [review]
The fix I just pushed
[Checkin: Comment 16+18 & 19 & 20]

A comment explaining why we're waiting for onload might not hurt, but I think this is fine.
Attachment #427903 - Flags: review?(gavin.sharp) → review+
Pushed a comment as http://hg.mozilla.org/mozilla-central/rev/975a17a14ec7
Status: ASSIGNED → RESOLVED
Closed: 14 years ago
Resolution: --- → FIXED
Flags: in-testsuite+
Keywords: checkin-needed
Whiteboard: [orange] → [c-n: to m-1.9.2 and m-1.9.1] [orange]
Target Milestone: --- → mozilla1.9.3a2
Comment on attachment 427903 [details] [diff] [review]
The fix I just pushed
[Checkin: Comment 16+18 & 19 & 20]


http://hg.mozilla.org/releases/mozilla-1.9.2/rev/6315d8b83a54
Attachment #427903 - Attachment description: The fix I just pushed → The fix I just pushed [Checkin: Comment 16+18 & 19]
Whiteboard: [c-n: to m-1.9.2 and m-1.9.1] [orange] → [c-n: to m-1.9.1] [orange]
Comment on attachment 427903 [details] [diff] [review]
The fix I just pushed
[Checkin: Comment 16+18 & 19 & 20]


(In reply to comment #19)
> http://hg.mozilla.org/releases/mozilla-1.9.2/rev/6315d8b83a54

Sorry, I pushed with my name...

***

http://hg.mozilla.org/releases/mozilla-1.9.1/rev/dec3225c7aaf
Attachment #427903 - Attachment description: The fix I just pushed [Checkin: Comment 16+18 & 19] → The fix I just pushed [Checkin: Comment 16+18 & 19 & 20]
Keywords: checkin-needed
Hardware: x86 → All
Whiteboard: [c-n: to m-1.9.1] [orange] → [orange]
Whiteboard: [orange]
Component: DOM → DOM: Core & HTML
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: