Closed Bug 1404454 Opened 2 years ago Closed 2 years ago

Intermittent netwerk/test/mochitests/test_1396395.html | Test timed out.

Categories

(Core :: Networking, defect, P2)

defect

Tracking

()

RESOLVED FIXED
mozilla59
Tracking Status
firefox58 --- fixed
firefox59 --- fixed

People

(Reporter: intermittent-bug-filer, Assigned: schien)

Details

(Keywords: intermittent-failure, Whiteboard: [necko-triaged][stockwell unknown])

Attachments

(1 file)

Timeout due to this line of error. Not sure why this is intermittent.
Take this bug since this test case is introduced by me.

>JavaScript error: http://mochi.test:8888/tests/netwerk/test/mochitests/test_1396395.html, line 38: SecurityError: Permission denied to access property "onunload" on cross-origin object
Assignee: nobody → schien
Whiteboard: [necko-triaged]
This bug has failed 35 in the last 7 days, most failures happened on Windows10-64, with a few failures on Windows 7, Linux-64 and OSX, build types are debug and pgo.

Here is a recent log: 
https://treeherder.mozilla.org/logviewer.html#?repo=mozilla-central&job_id=150363464&lineNumber=18612

And here is a part of the log:
INFO -  TEST-INFO | started process screenshot
00:26:37     INFO -  TEST-INFO | screenshot: exit 0
00:26:37    ERROR -  1019 INFO TEST-UNEXPECTED-FAIL | netwerk/test/mochitests/test_1396395.html | Test timed out.
00:26:37     INFO -      reportError@SimpleTest/TestRunner.js:121:7
00:26:37     INFO -      TestRunner._checkForHangs@SimpleTest/TestRunner.js:142:7
00:26:37     INFO -      setTimeout handler*TestRunner._checkForHangs@SimpleTest/TestRunner.js:163:5
00:26:37     INFO -      setTimeout handler*TestRunner._checkForHangs@SimpleTest/TestRunner.js:163:5
00:26:37     INFO -      setTimeout handler*TestRunner._checkForHangs@SimpleTest/TestRunner.js:163:5
00:26:37     INFO -      setTimeout handler*TestRunner._checkForHangs@SimpleTest/TestRunner.js:163:5
00:26:37     INFO -      setTimeout handler*TestRunner._checkForHangs@SimpleTest/TestRunner.js:163:5
00:26:37     INFO -      setTimeout handler*TestRunner._checkForHangs@SimpleTest/TestRunner.js:163:5
00:26:37     INFO -      setTimeout handler*TestRunner._checkForHangs@SimpleTest/TestRunner.js:163:5
00:26:37     INFO -      setTimeout handler*TestRunner._checkForHangs@SimpleTest/TestRunner.js:163:5
00:26:37     INFO -      setTimeout handler*TestRunner._checkForHangs@SimpleTest/TestRunner.js:163:5
00:26:37     INFO -      setTimeout handler*TestRunner._checkForHangs@SimpleTest/TestRunner.js:163:5
00:26:37     INFO -      setTimeout handler*TestRunner._checkForHangs@SimpleTest/TestRunner.js:163:5
00:26:37     INFO -      TestRunner.runTests@SimpleTest/TestRunner.js:380:5
00:26:37     INFO -      RunSet.runtests@SimpleTest/setup.js:194:3
00:26:37     INFO -      RunSet.runall@SimpleTest/setup.js:173:5
00:26:37     INFO -      hookupTests@SimpleTest/setup.js:266:5
00:26:37     INFO -  parseTestManifest@http://mochi.test:8888/manifestLibrary.js:36:5
00:26:37     INFO -  getTestManifest/req.onload@http://mochi.test:8888/manifestLibrary.js:49:11
00:26:37     INFO -  EventHandlerNonNull*getTestManifest@http://mochi.test:8888/manifestLibrary.js:45:3
00:26:37     INFO -      hookup@SimpleTest/setup.js:246:5

Hi :jduell: Can you please take a look at this bug?
Flags: needinfo?(jduell.mcbugs)
Whiteboard: [necko-triaged] → [necko-triaged][stockwell needswork]
SC, you volunteered yourself for this one :)   Can you take a look soon?
Flags: needinfo?(jduell.mcbugs) → needinfo?(schien)
With the help of additional logs, I found the test case stopped because the unload handler [1] for the iframe is not fired after changing the src. Need to figure out why.

[1] https://searchfox.org/mozilla-central/rev/cd742d763809089925a38178dd2ba5a9069fa855/netwerk/test/mochitests/test_1396395.html#38
Oh I missed there is an error message. The unload handler is not registered because of 
>16:47:03     INFO -  GECKO(2140) | JavaScript error: http://mochi.test:8888/tests/netwerk/test/mochitests/test_1396395.html, line 48: SecurityError: Permission denied to access property "onunload" on cross-origin object

Not sure why this is intermittent but I might use `about:blank` here to avoid the security error.
Flags: needinfo?(schien)
(In reply to Shih-Chiang Chien [:schien] (UTC+8) (use ni? plz) from comment #16)
> Oh I missed there is an error message. The unload handler is not registered
> because of 
> >16:47:03     INFO -  GECKO(2140) | JavaScript error: http://mochi.test:8888/tests/netwerk/test/mochitests/test_1396395.html, line 48: SecurityError: Permission denied to access property "onunload" on cross-origin object
> 
> Not sure why this is intermittent but I might use `about:blank` here to
> avoid the security error.

The try result looks promising. No failure in 106 runs of retry.
https://treeherder.mozilla.org/#/jobs?repo=try&revision=c595301566f613af4d60a9e3d63f528e82c50eaa
(In reply to Shih-Chiang Chien [:schien] (UTC+8) (use ni? plz) from comment #16)
> Oh I missed there is an error message. The unload handler is not registered
> because of 
> >16:47:03     INFO -  GECKO(2140) | JavaScript error: http://mochi.test:8888/tests/netwerk/test/mochitests/test_1396395.html, line 48: SecurityError: Permission denied to access property "onunload" on cross-origin object
> 
> Not sure why this is intermittent but I might use `about:blank` here to
> avoid the security error.

do you know why it is only sometimes failing? Is there another bug in there? Should it always fail or never fail? Sometimes sounds weird :)
Flags: needinfo?(schien)
Priority: -- → P2
(In reply to Dragana Damjanovic [:dragana] from comment #19)
> (In reply to Shih-Chiang Chien [:schien] (UTC+8) (use ni? plz) from comment
> #16)
> > Oh I missed there is an error message. The unload handler is not registered
> > because of 
> > >16:47:03     INFO -  GECKO(2140) | JavaScript error: http://mochi.test:8888/tests/netwerk/test/mochitests/test_1396395.html, line 48: SecurityError: Permission denied to access property "onunload" on cross-origin object
> > 
> > Not sure why this is intermittent but I might use `about:blank` here to
> > avoid the security error.
> 
> do you know why it is only sometimes failing? Is there another bug in there?
> Should it always fail or never fail? Sometimes sounds weird :)

No I don't really understand why, need to ask someone who knows about both DOM and JS. @mrbkap might be able to help.

@mrbkap, my test case [1] trying to add unload event handler on iframe.contentWindow. It works 99% of the time when the iframe.src is pointed to a cross-origin URL. In less than 1% of the chance that an security error raised. Changing the iframe.src to "about:blank" seems to make it works 100% of the time. Can you tell that if this is a bug of my test script or there are some hidden issues inside the Gecko?

[1] https://searchfox.org/mozilla-central/rev/281d99b3d342b71d0653b872345761372d38f5c1/netwerk/test/mochitests/test_1396395.html#38
Flags: needinfo?(schien) → needinfo?(mrbkap)
Talked to @mrbkap today. The security error is the expected behavior actually. This is passed because we access iframe.contentWindow before the iframe is actually loaded, we accidentally add the unload event handler on the `about:blank` window object because the OnStartRequest for that iframe has not arrived yet. My patch that uses `about:blank` in the initial src is the correct fix for it. The other way is to trigger the test step after the onload event, which will be happened after iframe is loaded.
Flags: needinfo?(mrbkap)
Comment on attachment 8936328 [details]
Bug 1404454 - use about:blank as the inital page of the testing iframe.

https://reviewboard.mozilla.org/r/207056/#review214016
Attachment #8936328 - Flags: review?(dd.mozilla) → review+
Pushed by schien@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/32eb8bbad8cb
use about:blank as the inital page of the testing iframe. r=dragana
https://hg.mozilla.org/mozilla-central/rev/32eb8bbad8cb
Status: NEW → RESOLVED
Closed: 2 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla59
You need to log in before you can comment on or make changes to this bug.