Beta mochitest(5) failing with test_ext_webrequest.html | Test timed out.

RESOLVED FIXED in Firefox 50

Status

()

Toolkit
WebExtensions: General
P1
blocker
RESOLVED FIXED
a year ago
a year ago

People

(Reporter: Treeherder Bug Filer, Assigned: kmag)

Tracking

unspecified
mozilla52
Points:
---
Dependency tree / graph

Firefox Tracking Flags

(firefox50 fixed, firefox51+ fixed, firefox52 fixed)

Details

(Whiteboard: triaged)

MozReview Requests

()

Submitter Diff Changes Open Issues Last Updated
Loading...
Error loading review requests:

Attachments

(2 attachments)

(Reporter)

Description

a year ago
treeherder
Filed by: wkocher [at] mozilla.com

https://treeherder.mozilla.org/logviewer.html#?job_id=1608440&repo=mozilla-beta

https://archive.mozilla.org/pub/firefox/tinderbox-builds/mozilla-beta-win32-pgo/1474292431/mozilla-beta_win7_ix_test_pgo-mochitest-e10s-5-bm109-tests1-windows-build14.txt.gz
status-firefox50: --- → affected
status-firefox51: --- → unaffected
Hi Giorgio, is this fallout from bug 1201979 / https://hg.mozilla.org/releases/mozilla-aurora/rev/3b04c5fb4e57

In the log, there is this:

09:34:47     INFO -  1249 INFO TEST-START | toolkit/components/extensions/test/mochitest/test_ext_webrequest.html
09:34:47     INFO -  1250 INFO SpawnTask.js | Entering test
09:34:47     INFO -  1251 INFO Extension loaded
09:34:47     INFO -  JavaScript error: moz-extension://1c4e5c7c-2080-4473-982b-e18a11e1e29b/%7B3b09dc87-a067-4618-af24-75dda4766505%7D.js, line 351: Error: Permission denied to access property "message"
09:39:56     INFO -  TEST-INFO | started process screenshot
09:39:56     INFO -  TEST-INFO | screenshot: exit 0
09:39:56     INFO -  1252 INFO TEST-UNEXPECTED-FAIL | toolkit/components/extensions/test/mochitest/test_ext_webrequest.html | Test timed out.
Flags: needinfo?(g.maone)
I think this feature was only enabled in aurora and nightly, so the test needs to be skipped on beta and release.
Kris did similar checks for webextension experiments like this:
http://searchfox.org/mozilla-central/source/toolkit/mozapps/extensions/test/xpcshell/test_webextension.js#307-309
What is happening at https://dxr.mozilla.org/mozilla-central/rev/f0f15b7c6aa77a0c5750918aa0a1cb3dc82185bc/toolkit/components/extensions/test/mochitest/test_ext_webrequest.html#446 is that the exception handler triggered by the expected lack of requestBody support in release builds unexpectedly throws, because the original exception's "message" property is not accessible for some reason ("permission denied", not sure why).

However, here we just wanted to check that the exception we are about to swallow is actually caused by requestBody not being supported, rather than any other unexpected cause which, on the other hand, seems very unlikely.

Therefore I believe just removing line 446 and 447 would be an acceptable fix.
Flags: needinfo?(g.maone)
Summary: Beta mochitest(5) failing with test_ext_webrequest.html | Test timed out. | after ReferenceError: SpecialPowers is not defined → Beta mochitest(5) failing with test_ext_webrequest.html | Test timed out.

Comment 4

a year ago
18 automation job failures were associated with this bug yesterday.

Repository breakdown:
* mozilla-beta: 16
* mozilla-inbound: 1
* autoland: 1

Platform breakdown:
* windows7-32: 4
* osx-10-10: 4
* linux32: 4
* windowsxp: 2
* windows8-64: 2
* linux64: 2

For more details, see:
https://brasstacks.mozilla.com/orangefactor/?display=Bug&bugid=1303798&startday=2016-09-19&endday=2016-09-19&tree=all
Severity: normal → blocker
Comment hidden (mozreview-request)
Comment on attachment 8792764 [details]
Bug 1303798 - Remove exception message check when requestBody is not supported.

Approval Request Comment
[Feature/regressing bug #]: 1201979
[User impact if declined]: tests fail
[Describe test coverage new/current, TreeHerder]: try on central (don't know how to test in beta)
[Risks and why]: it may swallow an exception revealing requestBody tests were skipped
[String/UUID change made/needed]: none
Attachment #8792764 - Flags: approval-mozilla-beta?
Attachment #8792764 - Flags: approval-mozilla-aurora?
Comment on attachment 8792764 [details]
Bug 1303798 - Remove exception message check when requestBody is not supported.

https://reviewboard.mozilla.org/r/79668/#review78428

Hm. I think the correct fix is to emit an error that actually belongs to the calling scope. I'm worried that this change is going to lead to this test failing and no-one noticing it.

The way that we normally handle this is by throwing either a bare object, and converting that to an Error that belongs to the calling scope from the schema wrappers in ExtensionUtils.jsm[1], or throwing an Error crated in the extension's scope to begin with.

So, ideally, I think we should probably handle this by changing the other function call wrappers to handle error objects that the extension doesn't have access to[2], and create an `Error` subclass that WebRequest.jsm can throw, which `normalizeError` can check so that it knows to use the original error message, rather than replacing it with "An unexpected error occurred".

[1]: http://searchfox.org/mozilla-central/rev/dbbbafc979a8362a1c8e3e99dbea188fc832b1c5/toolkit/components/extensions/ExtensionUtils.jsm#336
[2]: http://searchfox.org/mozilla-central/rev/dbbbafc979a8362a1c8e3e99dbea188fc832b1c5/toolkit/components/extensions/ExtensionUtils.jsm#1577
Attachment #8792764 - Flags: review?(kmaglione+bmo) → review-
In the short term, I'm just going to land a patch to beta that disables this call on non-release builds, so this stops failing. We can land a proper fix as a follow-up.
Comment on attachment 8792764 [details]
Bug 1303798 - Remove exception message check when requestBody is not supported.

Test-only changes are auto-approved for uplift.
Attachment #8792764 - Flags: approval-mozilla-beta?
Attachment #8792764 - Flags: approval-mozilla-aurora?
https://hg.mozilla.org/releases/mozilla-beta/rev/71b46b283225
status-firefox50: affected → fixed
status-firefox51: unaffected → affected
status-firefox52: --- → affected
thanks kris and mao
Status: NEW → RESOLVED
Last Resolved: a year ago
Resolution: --- → FIXED
This still needs to land on trunk and Aurora unless I'm mistaken?
Assignee: nobody → g.maone
Status: RESOLVED → REOPENED
Flags: needinfo?(cbook)
Resolution: FIXED → ---
kris, we need the same patch you checked-in on beta also on trunk and aurora or ? (could you attach the patch since its not the one the landed from this bug)
Flags: needinfo?(cbook) → needinfo?(kmaglione+bmo)
Aurora and central will need a longer term fix, as described in comment 7. The fix landed in beta is only a stopgap.
Flags: needinfo?(kmaglione+bmo)
However the "SpecialPowers is undefined" seems to be a real issue breaking requestBody file upload tests in non-release versions:


5929 07:51:31 INFO - ReferenceError: SpecialPowers is not defined
12040 08:04:19 INFO - 1538 INFO TEST-UNEXPECTED-FAIL | toolkit/components/extensions/test/mochitest/test_ext_webrequest.html | Upload http://mochi.test:8888/tests/toolkit/components/extensions/test/mochitest/file_WebRequest_page3.html?trigger=form&upload=%7B%22%5C%22special%5C%22+ch%C3%83%C2%A0rs%22%3A%5B%22sp%C3%A2%E2%80%9A%C2%ACcial%22%5D%2C%22testFile%22%3A%5B%22testFile.pdf%22%5D%2C%22emptyFile%22%3A%5B%22%22%5D%2C%22textInput1%22%3A%5B%22value1%22%5D%7D&enctype=multipart%2Fform-data #22 matc

https://treeherder.mozilla.org/logviewer.html#?job_id=27806425&repo=try#L5929

Might be anything new about SpecialPowers in mochitests causing this?
Flags: needinfo?(kmaglione+bmo)
The SpecialPowers error is a red herring. It looks like the problem is that the form data is coming through with broken encoding. Which is because of the patch for bug 1304331, which changes the encoding of the document to something unreasonable.
Flags: needinfo?(kmaglione+bmo)
20 automation job failures were associated with this bug in the last 7 days.

Repository breakdown:
* mozilla-beta: 18
* mozilla-inbound: 1
* autoland: 1

Platform breakdown:
* windows8-64: 4
* windows7-32: 4
* osx-10-10: 4
* linux32: 4
* windowsxp: 2
* linux64: 2

For more details, see:
https://brasstacks.mozilla.com/orangefactor/?display=Bug&bugid=1303798&startday=2016-09-19&endday=2016-09-25&tree=all

Updated

a year ago
Priority: -- → P1
Whiteboard: triaged
Keywords: intermittent-failure
Blocks: 1307010
Assignee: g.maone → kmaglione+bmo
i guess we need to fix the problem still on aurora because when aurora becomes beta we might run into this as tree closing again
[Tracking Requested - why for this release]:

aurora as beta uplift show perma failures/timeouts - so we need to fix this before merge day
tracking-firefox51: --- → ?
Flags: needinfo?(kmaglione+bmo)
Blocks moving 51 to beta; tracking.
tracking-firefox51: ? → +
Blocks: 1314492
This won't cause any problems when aurora becomes beta. The fix was for beta builds in general, not just the current beta.
Flags: needinfo?(kmaglione+bmo)
Actually, no, I guess I'm wrong, since I didn't land the fix.
Comment hidden (mozreview-request)
(In reply to Kris Maglione [:kmag] from comment #22)
> Actually, no, I guess I'm wrong, since I didn't land the fix.

:) https://treeherder.mozilla.org/#/jobs?repo=try&revision=80b53a49a79266832c5af7cc99d6442b9e239fbf&selectedJob=30468193&filter-searchStr=mochitest%20m(5) is actually the simlation that show the failures

Comment 25

a year ago
mozreview-review
Comment on attachment 8808018 [details]
Bug 1303798: Correctly propagate addListener errors from WebRequest.jsm to extension.

https://reviewboard.mozilla.org/r/90938/#review90866
Attachment #8808018 - Flags: review?(mixedpuppy) → review+
This is going to need a different patch for uplift unless we also uplift bug 1314493.
Depends on: 1314493
(In reply to Shane Caraveo (:mixedpuppy) from comment #26)
> This is going to need a different patch for uplift unless we also uplift bug
> 1314493.

Yeah. Can you request uplift for that? It's probably a good idea, anyway.

Comment 28

a year ago
Pushed by maglione.k@gmail.com:
https://hg.mozilla.org/integration/autoland/rev/045ce2ca1b7d
Correctly propagate addListener errors from WebRequest.jsm to extension. r=mixedpuppy
Comment on attachment 8808018 [details]
Bug 1303798: Correctly propagate addListener errors from WebRequest.jsm to extension.

Approval Request Comment
[Feature/regressing bug #]: Bug 1201979
[User impact if declined]: This bug causes extensions to receive an Error object that they do not have privileges to access, which incidentally causes tests to fail when running in a beta or release build.
[Describe test coverage new/current, TreeHerder]: Existing tests detect this issue and confirm that it's fixed when running on beta.
[Risks and why]: Very low. This change primarily ensures that extensions can access an error object that they are intended to be able to access.
[String/UUID change made/needed]: None.
Attachment #8808018 - Flags: approval-mozilla-aurora?
I had to back this out for bustage like https://treeherder.mozilla.org/logviewer.html#?job_id=6245609&repo=autoland

https://hg.mozilla.org/integration/autoland/rev/7e604b351f4faaa1f602c02dbae5639ce4d16b47
Flags: needinfo?(kmaglione+bmo)
Turns out I tested with the RELEASE_OR_BETA flag set, but forgot to test without it...
Flags: needinfo?(kmaglione+bmo)
https://hg.mozilla.org/integration/mozilla-inbound/rev/8c2ad6366c6be9fce02428ca22b973be8d9d295b
Bug 1303798: Correctly propagate addListener errors from WebRequest.jsm to extension. r=mixedpuppy

Comment 33

a year ago
bugherder
https://hg.mozilla.org/mozilla-central/rev/8c2ad6366c6b
Status: REOPENED → RESOLVED
Last Resolved: a year agoa year ago
status-firefox52: affected → fixed
Resolution: --- → FIXED
Target Milestone: --- → mozilla52
Comment on attachment 8808018 [details]
Bug 1303798: Correctly propagate addListener errors from WebRequest.jsm to extension.

Fix a mochitest error when running on beta. Take it in 51 aurora.
Attachment #8808018 - Flags: approval-mozilla-aurora? → approval-mozilla-aurora+
needs rebasing for aurora

merging toolkit/components/extensions/ExtensionUtils.jsm
merging toolkit/components/extensions/test/mochitest/test_ext_webrequest_upload.html
merging toolkit/modules/addons/WebRequest.jsm
warning: conflicts while merging toolkit/components/extensions/ExtensionUtils.jsm! (edit, then use 'hg resolve --mark')
abort: unresolved conflicts, can't continue
(use 'hg resolve' and 'hg graft --continue')
Flags: needinfo?(kmaglione+bmo)
https://hg.mozilla.org/releases/mozilla-aurora/rev/94d52b7d3d048a05f67f2c3c1736e4f1bdf5eee3
status-firefox51: affected → fixed
Flags: needinfo?(kmaglione+bmo)
(Reporter)

Updated

a year ago
Depends on: 1317337
You need to log in before you can comment on or make changes to this bug.