Closed Bug 487750 Opened 16 years ago Closed 16 years ago

test_plugin_clipping.xhtml fails randomly

Categories

(Core :: Layout, defect)

All
macOS
defect
Not set
normal

Tracking

()

RESOLVED FIXED

People

(Reporter: jaas, Unassigned)

References

Details

(Keywords: intermittent-failure)

Attachments

(1 file)

OS X 10.5.2 mozilla-central unit test: *** 43911 ERROR TEST-UNEXPECTED-FAIL | /tests/layout/generic/test/test_plugin_clipping.xhtml | Matching regions: expected {100,100,200,200}, got {100,100,100,100} 43911 ERROR TEST-UNEXPECTED-FAIL | /tests/layout/generic/test/test_plugin_clipping.xhtml | Matching regions: expected {100,100,200,200}, got {100,100,100,100} make: *** [mochitest-plain] Error 1 Unknown Error: command finished with exit code: 2 I can reproduce this locally on Mac OS X 10.5 and backing out the patches that landed before the failure doesn't help, I think this is rando-orange.
Blocks: 438871
Whiteboard: [orange]
Version: unspecified → Trunk
http://tinderbox.mozilla.org/showlog.cgi?log=Firefox/1241499951.1241508444.8098.gz OS X 10.5.2 mozilla-central unit test on 2009/05/04 22:05:51
http://tinderbox.mozilla.org/showlog.cgi?log=Firefox/1242996699.1243001825.10343.gz OS X 10.5.2 mozilla-central unit test on 2009/05/22 05:51:39 http://tinderbox.mozilla.org/showlog.cgi?log=Firefox/1243006918.1243012055.3029.gz OS X 10.5.2 mozilla-central unit test on 2009/05/22 08:41:58
http://tinderbox.mozilla.org/showlog.cgi?log=Firefox/1243222356.1243231703.4915.gz OS X 10.5.2 mozilla-central unit test on 2009/05/24 20:32:36
http://tinderbox.mozilla.org/showlog.cgi?log=Firefox/1243982231.1243987298.24702.gz OS X 10.5.2 mozilla-central unit test on 2009/06/02 15:37:11
I can get this to fail consistently by inserting for (var start = new Date; new Date - start < 1000; ); anywhere such that it runs before window.onload fires (i.e., before runTests runs). When the unmodified test case fails intermittently, it's almost always on the first run of the test (fresh cache?), when the child window stays open for a longer-than-usual amount of time. Adding the busy loop just exaggerates the delay.
Even with the busy loop, I can rescue the test from failure if I introduce a slight delay beyond window.onload: function runTests() { if (!runTests.repeat) return setTimeout(runTests.repeat = runTests, 1000); ... } for (var start = new Date; new Date - start < 1000; ); window.addEventListener("load", runTests, false); Any ideas?
So... the test has this code: var p = document.getElementById("p1"); if (p.getClipRegionRectEdge(0, 0) == p.getClipRegionRectEdge(0, 2)) { // plugin hasn't been updated yet. wait. setTimeout(runTests2, 100); return; } Why exactly is it needed? Why is it enough to test "p1" only? If I remove that code, all the tests fail, and the failure for the fifth one is precisely the one for this bug.... Does the plug-in run some sort of initialization code in a separate thread, and is this waiting for that to finish or something?
OK, looks like we update the clip region in the plug-in at random times (from painting, off a timer, etc, etc). See nsPluginInstanceOwner::FixUpPluginWindow. Which means that we have no reasonable way to know when it's safe to read the clip region data from the plug-in on mac, as far as I can tell. The above setTimeout seems to try to deal with it, but it looks like there can be cases where we've set up the right clip rect on the parent doc but not yet on the plug-in in the iframe. If that happens, we get fail. At least that's my best guess.
In particular, this guarantees that the <embed id="p5"> inside of <iframe id="f1"> updates before we check its clipping region.
Attachment #381612 - Flags: superreview?
Attachment #381612 - Flags: review?
Attachment #381612 - Flags: superreview?(bzbarsky)
Attachment #381612 - Flags: superreview?
Attachment #381612 - Flags: review?(bzbarsky)
Attachment #381612 - Flags: review?
Attachment #381612 - Flags: superreview?(bzbarsky)
Attachment #381612 - Flags: superreview+
Attachment #381612 - Flags: review?(bzbarsky)
Attachment #381612 - Flags: review+
Comment on attachment 381612 [details] [diff] [review] waiting for all plugins to update I assume this did help?
(In reply to comment #15) > (From update of attachment 381612 [details] [diff] [review]) > I assume this did help? By all appearances, yes. Can't reproduce anymore.
Status: NEW → RESOLVED
Closed: 16 years ago
Resolution: --- → FIXED
FWIW, this test just failed on Linux: http://tinderbox.mozilla.org/showlog.cgi?log=Firefox/1251926815.1251935132.23792.gz Linux mozilla-central unit test on 2009/09/02 14:26:55 > 46779 ERROR TEST-UNEXPECTED-FAIL | /tests/layout/generic/test/test_plugin_clipping.xhtml | Matching regions for 'p1': expected {0,0,200,200}, got > 46794 ERROR TEST-UNEXPECTED-FAIL | /tests/layout/generic/test/test_plugin_clipping.xhtml | Matching regions for 'p4': expected {100,100,200,200}, got {100,100,200,166} > 46799 ERROR TEST-UNEXPECTED-FAIL | /tests/layout/generic/test/test_plugin_clipping.xhtml | Matching regions for 'p5': expected {100,100,200,200}, got I'm not 100% sure if it's sporadic, since it's still the most recent cycle. But it looks like it -- the previous tinderbox cycle didn't have this test-failure (though it did have a different known-sporadic failure), and the only change between these two cycles was a patch from blassey in Windows-only widget code. Assuming the failure doesn't stick, I'll file a new bug on this.
Yup, the next cycle went green -- filed Bug 514321 on the new Linux sporadic failure in this test.
Whiteboard: [orange]
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: