Closed Bug 1637431 Opened 5 years ago Closed 5 years ago

tabs.query should provide a message more useful than “unexpected error” if url format is invalid

Categories

(WebExtensions :: General, defect, P3)

Desktop
All
defect

Tracking

(firefox79 fixed)

RESOLVED FIXED
mozilla79
Tracking Status
firefox79 --- fixed

People

(Reporter: aria, Assigned: deeps.karanji2, Mentored)

References

Details

(Keywords: good-first-bug)

Attachments

(1 file, 4 obsolete files)

Right now, await browser.tabs.query({url: "http://example.net"}); fails with Error: An unexpected error occurred, providing no explanation as to why it failed, looking more like a frustrating browser bug than an incorrect use of the WebExtensions API.

Instead, Firefox should provide an error message telling the user that one of the provided URL pattern is invalid and telling which one is invalid.

For reference, here’s what latest Chromium tells me:
Unchecked runtime.lastError: Invalid url pattern 'http://example.net'
which is already much more clear.

Severity: -- → S4
Type: enhancement → defect
Priority: -- → P3
Mentor: lgreco
Status: UNCONFIRMED → NEW
Ever confirmed: true
Keywords: good-first-bug

Hello,
I am a beginner to open source contributions and https://github.com/mozilla/addons-server/blob/master/.github/CONTRIBUTING.rst led me to this page and I'd like to fix this issue.
I apologize in advance if I am asking simple questions, but how do I contribute to the code at Bugzilla? Does it map to a Github repository?

Regards,
Deepika Karanji

Hello Again,
I did a bit of looking around and I have now built Firefox from source by cloning the Mozilla-central repo using Mercurial. Could someone guide me to the file I'm supposed to be looking at to fix this?

Thanks!

Flags: needinfo?(lgreco)

I'll mentor this bug since Luca isn't available today.

Before changing any code at all, I recommend to set up your development environment and verify that you are able to run unit tests. With that, it will be easier to verify that the proposed fix works as intended.

To get started, read https://wiki.mozilla.org/WebExtensions/Contribution_Onramp . You've already got a checkout, so to complete the setup you need to run mach bootstrap (and choose artifact builds), and finally run mach build. After building Firefox, follow the instructions at the "Testing" section to run tests.

Comment 1 shows the two relevant files where the API is currently implemented. As you may notice, the implementations are identical. To avoid code duplication, move the code to https://searchfox.org/mozilla-central/rev/559b25eb41c1cbffcb90a34e008b8288312fcd25/toolkit/components/extensions/parent/ext-tabs-base.js#1964 . Then to verify that the code still works as intended, run mach test browser/components/extensions/test/browser/browser_ext_tabs_query.js

Once you have familiarized yourself with running tests and making small changes, the next step is to actually work on this bug:

  • add a unit test to browser_ext_tabs_query.js that uses await browser.test.assertRejects to verify that using tabs.query with an invalid URL results in a meaningful message.
  • change the implementation, and wrap the queryInfo.url = new MatchPatternSet( ... ) in try-catch, and throw an ExtensionError with a meaningful error message.
Mentor: lgreco → rob
Flags: needinfo?(lgreco)

I ran the tests successfully and made some small changes to familiarize myself. Initially running mach test browser/components/extensions/test/browser/browser_ext_tabs_query.js worked fine, all tests passed.

When I tried to to hg update -r559b25eb41c1cbffcb90a34e008b8288312fcd25, it says that this is an invalid revision number. So I went ahead with the latest revision by doing a hg pull and tried to add

*query(queryInfo = null, context = null) {
    function* candidates(windowWrapper) {
      if (queryInfo) {
        let { active, highlighted, index } = queryInfo;
        if (active === true) {
          yield windowWrapper.activeTab;
          return;
        }
        if (queryInfo.url !== null) {
            queryInfo.url = new MatchPatternSet([].concat(queryInfo.url), {
              restrictSchemes: false,
            });
        }
....
    }
}

to mozilla-central/toolkit/components/extensions/parent/ext-tabs-base.js#1964
Then when I tried running mach test browser/components/extensions/test/browser/browser_ext_tabs_query.js throws this:

0:10.55 PASS tab 0 title correct - Expected: Gort! Klaatu barada nikto!, Actual: Gort! Klaatu barada nikto! - 
 0:10.55 INFO Console message: [JavaScript Error: "[Exception... "Illegal value"  nsresult: "0x80070057 (NS_ERROR_ILLEGAL_VALUE)"  location: "JS frame :: chrome://extensions/content/parent/ext-tabs-base.js :: candidates :: line 1973"  data: no]"]
...
0:10.55 INFO Console message: [JavaScript Error: "Error: An unexpected error occurred" {file: "undefined" line: 0}]
background@moz-extension://59717483-177b-4f29-8020-f942f33dc26f/%7B451b8115-f3b8-43f5-902d-d172a86da373%7D.js:32:20
async*@moz-extension://59717483-177b-4f29-8020-f942f33dc26f/%7B451b8115-f3b8-43f5-902d-d172a86da373%7D.js:33:7

Does this mean that the way I've added those two lines is wrong? Or have I misunderstood what you meant by "move the code.."?
Thanks!

Flags: needinfo?(rob)

Hi,
I fixed this. Sorry!
I'll get started on the bug now :)
Thanks!

Flags: needinfo?(rob)
Attached file Unit test to check invalid url (obsolete) —

Added unit test in mozilla-central/browser/components/extensions/test/browser/browser_ext_tabs_query.js

Attachment #9154198 - Flags: review?(rob)

Modified implementation in mozilla-central/toolkit/components/extensions/parent/ext-tabs-base.js after moving the code from mozilla-central/browser/components/extensions/parent/ext-tabs.js.

I also ran ./mach test browser/components/extensions/test/browser/browser_ext_tabs_query.js successfully.

Please let me know if I'm required to make any further changes, and what steps I must take next :)

Flags: needinfo?(rob)
Attachment #9154200 - Flags: review?(rob)
Attached patch Unit test to check invalid url (obsolete) — Splinter Review

Added unit test in mozilla-central/browser/components/extensions/test/browser/browser_ext_tabs_query.js

Attachment #9154198 - Attachment is obsolete: true
Attachment #9154198 - Flags: review?(rob)
Attachment #9154201 - Flags: review?(rob)

I'm new to bugzila, so in case the format in which I have submitted my patches for review are incorrect, please do let me know how I can correct it. Thanks!

Could you submit the patch to Phabricator instead of Bugzilla? See https://wiki.mozilla.org/WebExtensions/Contribution_Onramp#Submitting_a_Patch

Flags: needinfo?(rob)

I submitted it now. I wasn't sure if your reviewer handle was rob@robwu.nl or just robwu.. so I didn't add that in the commit message. It currently says "Reviewers: extension-reviewers".

Flags: needinfo?(rob)

Bug 1637431 - Gives meaningful error message for tabs.query.

Bug 1637431 - Gives useful error message for tabs.query.

Assignee: nobody → deeps.karanji2
Status: NEW → ASSIGNED

(In reply to deeps.karanji2 from comment #12)

I submitted it now. I wasn't sure if your reviewer handle was rob@robwu.nl or just robwu.. so I didn't add that in the commit message. It currently says "Reviewers: extension-reviewers".

Good question! You can use "robwu". If you upload a patch with one of the tools linked from comment 11, then you can use Bug 1637431 - short description here r=robwu to publish a patch and request me as a reviewer. The patch will automatically appear as an attachment on this bug.

I'm not sure why https://phabricator.services.mozilla.com/D78363 isn't linked here. Did you use the standard tools or something else (such as manual upload through the web interface)?

Attachment #9154200 - Attachment is obsolete: true
Flags: needinfo?(rob)
Attachment #9154200 - Flags: review?(rob)
Attachment #9154201 - Attachment is obsolete: true
Attachment #9154201 - Flags: review?(rob)

Thanks, I'll add the handle and try again. Maybe that is the issue?
I did the following:
hg addremove moz-phab //after installing and then 2 factor auth hg commit arc diff
Is there something I should change here?
https://github.com/mozilla-conduit/review/blob/master/README.md tells me that I should do mozphab arc diff, but I didnt really understand the difference.

Flags: needinfo?(rob)

Ah the newlines got messed up, should have done a preview. Sorry about that.

I did the following:

hg addremove
moz-phab //after installing and then 2 factor auth
hg commit
arc diff

Is there something I should change here?
https://github.com/mozilla-conduit/review/blob/master/README.md tells me that I should do mozphab arc diff, but I didnt really understand the difference, so I just did arc diff.

Flags: needinfo?(rob)

You should just have used moz-phab . I'll update the onramp wiki to clarify.
It is documented at: https://github.com/mozilla-conduit/review/blob/master/README.md#submitting-commits-to-phabricator

See the updated documentation with explicit instructions at https://wiki.mozilla.org/WebExtensions/Contribution_Onramp#Submitting_a_Patch

Hi,
I submitted the changes at https://phabricator.services.mozilla.com/D78466, which got auto-attached to this bug now :)
I think I have to figure out how to do commits to the same revision. I'll read up, sorry about that.

I did the following:
hg addremove
hg commit // message: Bug 1637431 - Gives meaningful tabs.query error message. r=robwu
hg histedit - there were 4 commits here, I wanted to submit only the latest one
hg strip <changesets>
hg commit
moz-phab

I am yet to fix the android file at https://searchfox.org/mozilla-central/rev/df4c90d4b8c92c99f76334acfe4813c573c12661/mobile/android/components/extensions/ext-tabs.js#469-473, I thought I'll get to it once I got this reviewed :)

Flags: needinfo?(rob)

(In reply to deeps.karanji2 from comment #20)

Hi,
I submitted the changes at https://phabricator.services.mozilla.com/D78466, which got auto-attached to this bug now :)
I think I have to figure out how to do commits to the same revision. I'll read up, sorry about that.

It should be fine for the next attempt to upload, but if you ever find yourself in a situation where you need to create a new commit and replace an existing Phabricator revision with it, see https://github.com/mozilla-conduit/review/blob/master/README.md#associating-a-commit-to-an-existing-phabricator-revision

To remove the old Phabricator patch, visit the old revision at https://phabricator.services.mozilla.com/D78363 , click on the dropdown and choose "Abandon". Then the patch will automatically be marked as obsolete on Bugzilla and it will be removed from the list of patches at the top of this bug.

Flags: needinfo?(rob)
Attachment #9154322 - Attachment is obsolete: true
Attachment #9154492 - Attachment description: Bug 1637431 - Gives meaningful tabs.query error message. r=robwu → Bug 1637431 - Updated Android implementation. r=robwu
Attachment #9154492 - Attachment description: Bug 1637431 - Updated Android implementation. r=robwu → Bug 1637431 - Gives meaningful tabs.query error message. r=robwu

Hi, I've made the changes, I think its not getting attached here because the page says that Phabricator is being updated to the latest release, and the CI Treeherder job is still building. Since I am not sure how long this update may take, please find the updated revision at https://phabricator.services.mozilla.com/D78466.
Thanks :)

Flags: needinfo?(rob)

This is normal. There will only be an update in Bugzilla in the following cases:

  • when the Phabricator revision is created (creating an attachment in Bugzilla)
  • when the Phabricator revision is abandoned (marking the attachment in Bugzilla as obsolete)
  • when the patch lands (this is not related to Phabricator, but coincides with closing the Phabricator revision is closed)
  • when a Nightly release is created that includes the patch.
  • (of if you are unlucky:) when the patch is backed out after landing, due to (test) failures.
Flags: needinfo?(rob)

Oh okay! Thanks!

Quick question:
Every time you've asked me to implement a function, I know exactly how to do it, but I'm never sure where to place the implementation, especially because there are so many files I have no idea about.
Right now, you've asked me to place the parseMatchPatterns in the ExtensionUtils.jsm, but I wouldn't have been able to figure that out on my own. I just made it a method of a class because I knew it would work if I placed it there.

Is there any way I could have known the right location without guidance? Where should I have looked?

Flags: needinfo?(rob)

(In reply to Deepika Karanji from comment #24)

Oh okay! Thanks!

Quick question:
Every time you've asked me to implement a function, I know exactly how to do it, but I'm never sure where to place the implementation, especially because there are so many files I have no idea about.
Right now, you've asked me to place the parseMatchPatterns in the ExtensionUtils.jsm, but I wouldn't have been able to figure that out on my own. I just made it a method of a class because I knew it would work if I placed it there.

Is there any way I could have known the right location without guidance? Where should I have looked?

There are no hard rules on where to put the function.
Placing it within the same file works, and is a good default. I asked to put it in ExtensionUtils to allow it to be shared by other functions. It could have been in toolkit/components/extensions/parent/ext-toolkit.js (which is shared by all ext-*.js script), but I opted for ExtensionUtils because the utility method is independent of other logic in ext-*.js. Someone else might have suggested ext-toolkit.js or ExtensionCommon.js, which wouldn't be incorrect either.

Flags: needinfo?(rob)
Attachment #9154492 - Attachment description: Bug 1637431 - Gives meaningful tabs.query error message. r=robwu → Bug 1637431 - Removed a comment line, rev approved. r=robwu
Pushed by btara@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/436777b95e22 Removed a comment line, rev approved. r=robwu,geckoview-reviewers,agi
Attachment #9154492 - Attachment description: Bug 1637431 - Removed a comment line, rev approved. r=robwu → Bug 1637431 - Gives meaningful tabs.query error message. r=robwu
Pushed by btara@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/61bdbb94ab7a Gives meaningful tabs.query error message. r=robwu,geckoview-reviewers,agi

(In reply to Alexandru Michis [:malexandru] from comment #27)

Backed out changeset 436777b95e22 for causing bc failures in browser_ext_tabs_cookieStoreId.js

Backout link: https://hg.mozilla.org/integration/autoland/rev/fdd5f38d3079f93be3b7081d4a2c82c4030e15a2

Push with failures: https://treeherder.mozilla.org/#/jobs?repo=autoland&group_state=expanded&resultStatus=success%2Ctestfailed%2Cbusted%2Cexception%2Crunnable&tochange=fdd5f38d3079f93be3b7081d4a2c82c4030e15a2&searchStr=%28bc&fromchange=9227546b040c21fce04d79a99611a364fec6de5f&selectedTaskRun=biexOkUySBqyre9nMoBO2Q-0

Failure log: https://treeherder.mozilla.org/logviewer.html#/jobs?job_id=305888387&repo=autoland&lineNumber=17324

I think its because the commit title of the revision that was approved and the latest commit title weren't the same.
I followed the links you have provided and Backed out changeset 436777b95e22 (bug 1637431) for causing bc failures in browser_ext_tabs_cookieStoreId.js may be unrelated to the change in title, so I'll have to look into that.
In any case, just to be sure, I've re-titled it and submitted a request for Check In.

@RobWu, could you help me out?

Flags: needinfo?(deeps.karanji2) → needinfo?(rob)

Backed out changeset 61bdbb94ab7a (bug 1637431) for browser_ext_tabs_cookieStoreId.js

Push with failure: https://treeherder.mozilla.org/#/jobs?repo=autoland&fromchange=61bdbb94ab7abd434c60e2a40fa9f07b11237ebb&searchStr=mochitest&tochange=fa7ac846869628b7203bccc91bf1dc89b30067a7&selectedTaskRun=IqnG3PaMTSiJJ_otVzXktA-0

Backout link: https://hg.mozilla.org/integration/autoland/rev/fa7ac846869628b7203bccc91bf1dc89b30067a7

Failure log: https://treeherder.mozilla.org/logviewer.html#/jobs?job_id=305889351&repo=autoland&lineNumber=3304

[task 2020-06-11T04:24:21.842Z] 04:24:21     INFO - TEST-START | browser/components/extensions/test/browser/browser_ext_tabs_cookieStoreId.js
[task 2020-06-11T04:24:21.843Z] 04:24:21     INFO - GECKO(1263) | [SimpleTest.requestLongerTimeout()] ignoring request, maybe you meant to call the global `requestLongerTimeout` instead?
[task 2020-06-11T04:24:24.108Z] 04:24:24     INFO - TEST-INFO | started process screentopng
[task 2020-06-11T04:24:24.835Z] 04:24:24     INFO - TEST-INFO | screentopng: exit 0
[task 2020-06-11T04:24:24.839Z] 04:24:24     INFO - Buffered messages logged at 04:24:21
[task 2020-06-11T04:24:24.840Z] 04:24:24     INFO - Entering test bound setup
[task 2020-06-11T04:24:24.840Z] 04:24:24     INFO - Leaving test bound setup
[task 2020-06-11T04:24:24.841Z] 04:24:24     INFO - Entering test bound 
[task 2020-06-11T04:24:24.842Z] 04:24:24     INFO - Start testing tabs.create with cookieStoreId
[task 2020-06-11T04:24:24.842Z] 04:24:24     INFO - Extension loaded
[task 2020-06-11T04:24:24.843Z] 04:24:24     INFO - Console message: Warning: attempting to write 26675 bytes to preference extensions.webextensions.uuids. This is bad for general performance and memory usage. Such an amount of data should rather be written to an external file. This preference will not be sent to any content processes.
[task 2020-06-11T04:24:24.844Z] 04:24:24     INFO - Buffered messages logged at 04:24:22
[task 2020-06-11T04:24:24.844Z] 04:24:24     INFO - Tests must be ready...
[task 2020-06-11T04:24:24.845Z] 04:24:24     INFO - Buffered messages logged at 04:24:23
[task 2020-06-11T04:24:24.845Z] 04:24:24     INFO - Tests are ready to run!
[task 2020-06-11T04:24:24.850Z] 04:24:24     INFO - test tab.create with cookieStoreId: "null"
[task 2020-06-11T04:24:24.851Z] 04:24:24     INFO - Buffered messages logged at 04:24:24
[task 2020-06-11T04:24:24.851Z] 04:24:24     INFO - TEST-PASS | browser/components/extensions/test/browser/browser_ext_tabs_cookieStoreId.js | we want a success - 
[task 2020-06-11T04:24:24.852Z] 04:24:24     INFO - TEST-PASS | browser/components/extensions/test/browser/browser_ext_tabs_cookieStoreId.js | we want a success - 
[task 2020-06-11T04:24:24.853Z] 04:24:24     INFO - TEST-PASS | browser/components/extensions/test/browser/browser_ext_tabs_cookieStoreId.js | we have a tab - 
[task 2020-06-11T04:24:24.853Z] 04:24:24     INFO - TEST-PASS | browser/components/extensions/test/browser/browser_ext_tabs_cookieStoreId.js | tab should have the correct cookieStoreId - Expected: firefox-default, Actual: firefox-default - 
[task 2020-06-11T04:24:24.854Z] 04:24:24     INFO - TEST-PASS | browser/components/extensions/test/browser/browser_ext_tabs_cookieStoreId.js | Tab found! - 
[task 2020-06-11T04:24:24.854Z] 04:24:24     INFO - TEST-PASS | browser/components/extensions/test/browser/browser_ext_tabs_cookieStoreId.js | we want a success - 
[task 2020-06-11T04:24:24.855Z] 04:24:24     INFO - TEST-PASS | browser/components/extensions/test/browser/browser_ext_tabs_cookieStoreId.js | we have a tab - 
[task 2020-06-11T04:24:24.855Z] 04:24:24     INFO - TEST-PASS | browser/components/extensions/test/browser/browser_ext_tabs_cookieStoreId.js | tab should have the correct cookieStoreId - Expected: firefox-default, Actual: firefox-default - 
[task 2020-06-11T04:24:24.861Z] 04:24:24     INFO - Console message: [JavaScript Error: "can't access property "url", queryInfo is null" {file: "chrome://extensions/content/parent/ext-tabs-base.js" line: 1966}]
[task 2020-06-11T04:24:24.861Z] 04:24:24     INFO - query@chrome://extensions/content/parent/ext-tabs-base.js:1966:9
[task 2020-06-11T04:24:24.862Z] 04:24:24     INFO - getAllCookieStores@chrome://extensions/content/parent/ext-cookies.js:529:11
[task 2020-06-11T04:24:24.862Z] 04:24:24     INFO - recvAPICall/result</<@resource://gre/modules/ExtensionParent.jsm:930:68
[task 2020-06-11T04:24:24.863Z] 04:24:24     INFO - withPendingBrowser@resource://gre/modules/ExtensionParent.jsm:485:26
[task 2020-06-11T04:24:24.863Z] 04:24:24     INFO - recvAPICall/result<@resource://gre/modules/ExtensionParent.jsm:930:24
[task 2020-06-11T04:24:24.864Z] 04:24:24     INFO - callAndLog@resource://gre/modules/ExtensionParent.jsm:892:14
[task 2020-06-11T04:24:24.864Z] 04:24:24     INFO - recvAPICall@resource://gre/modules/ExtensionParent.jsm:929:25
[task 2020-06-11T04:24:24.864Z] 04:24:24     INFO - Async*_recv@resource://gre/modules/ConduitsChild.jsm:78:20
[task 2020-06-11T04:24:24.864Z] 04:24:24     INFO - receiveMessage@resource://gre/modules/ConduitsParent.jsm:364:20
[task 2020-06-11T04:24:24.864Z] 04:24:24     INFO - JSActor query*_send@resource://gre/modules/ConduitsChild.jsm:63:11
[task 2020-06-11T04:24:24.865Z] 04:24:24     INFO - _send@resource://gre/modules/ConduitsChild.jsm:111:18
[task 2020-06-11T04:24:24.865Z] 04:24:24     INFO - callParentAsyncFunction@resource://gre/modules/ExtensionChild.jsm:833:18
[task 2020-06-11T04:24:24.865Z] 04:24:24     INFO - callAsyncFunction@resource://gre/modules/ExtensionChild.jsm:597:33
[task 2020-06-11T04:24:24.865Z] 04:24:24     INFO - stub@resource://gre/modules/Schemas.jsm:2679:30
[task 2020-06-11T04:24:24.865Z] 04:24:24     INFO - runTest@moz-extension://b546f540-693b-40dc-95fe-f142864db616/%7B85e765a3-1731-496b-b1dd-343cdbcd9517%7D.js:74:46
[task 2020-06-11T04:24:24.865Z] 04:24:24     INFO - async*@moz-extension://b546f540-693b-40dc-95fe-f142864db616/%7B85e765a3-1731-496b-b1dd-343cdbcd9517%7D.js:112:18
[task 2020-06-11T04:24:24.866Z] 04:24:24     INFO - getAPI/addListener/<@chrome://extensions/content/child/ext-test.js:111:22
[task 2020-06-11T04:24:24.866Z] 04:24:24     INFO - applySafeWithoutClone@resource://gre/modules/ExtensionCommon.jsm:614:24
[task 2020-06-11T04:24:24.866Z] 04:24:24     INFO - applySafe@resource://gre/modules/ExtensionCommon.jsm:597:19
[task 2020-06-11T04:24:24.866Z] 04:24:24     INFO - addListener/async/<@resource://gre/modules/ExtensionCommon.jsm:2411:39
[task 2020-06-11T04:24:24.867Z] 04:24:24     INFO - promise callback*async@resource://gre/modules/ExtensionCommon.jsm:2409:34
[task 2020-06-11T04:24:24.867Z] 04:24:24     INFO - handler@chrome://extensions/content/child/ext-test.js:243:20
[task 2020-06-11T04:24:24.867Z] 04:24:24     INFO - emit@resource://gre/modules/ExtensionCommon.jsm:327:32
[task 2020-06-11T04:24:24.867Z] 04:24:24     INFO - receiveMessage@resource://gre/modules/ExtensionChild.jsm:523:13
[task 2020-06-11T04:24:24.868Z] 04:24:24     INFO - MessageListener.receiveMessage*BrowserExtensionContent@resource://gre/modules/ExtensionChild.jsm:358:19
[task 2020-06-11T04:24:24.868Z] 04:24:24     INFO - extensions<@resource://gre/modules/ExtensionProcessScript.jsm:58:10
[task 2020-06-11T04:24:24.869Z] 04:24:24     INFO - get@resource://gre/modules/ExtensionUtils.jsm:86:20
[task 2020-06-11T04:24:24.869Z] 04:24:24     INFO - initExtensionDocument@resource://gre/modules/ExtensionProcessScript.jsm:389:32
[task 2020-06-11T04:24:24.870Z] 04:24:24     INFO - 
[task 2020-06-11T04:24:24.870Z] 04:24:24     INFO - Buffered messages finished
[task 2020-06-11T04:24:24.870Z] 04:24:24     INFO - TEST-UNEXPECTED-FAIL | browser/components/extensions/test/browser/browser_ext_tabs_cookieStoreId.js | An exception has been thrown - 
[task 2020-06-11T04:24:24.870Z] 04:24:24     INFO - Stack trace:
[task 2020-06-11T04:24:24.870Z] 04:24:24     INFO - chrome://mochikit/content/browser-test.js:test_ok:1299
[task 2020-06-11T04:24:24.871Z] 04:24:24     INFO - chrome://mochikit/content/tests/SimpleTest/ExtensionTestUtils.js:testHandler:72
[task 2020-06-11T04:24:24.871Z] 04:24:24     INFO - chrome://mochikit/content/tests/SimpleTest/ExtensionTestUtils.js:testResult:82
[task 2020-06-11T04:24:24.871Z] 04:24:24     INFO - resource://specialpowers/SpecialPowersChild.jsm:listener:2157
[task 2020-06-11T04:24:24.871Z] 04:24:24     INFO - resource://specialpowers/SpecialPowersChild.jsm:loadExtension/<:2099
[task 2020-06-11T04:24:24.872Z] 04:24:24     INFO - resource://specialpowers/SpecialPowersChild.jsm:receiveMessage:275
[task 2020-06-11T04:24:24.872Z] 04:24:24     INFO - JSActor query*resource://specialpowers/SpecialPowersParent.jsm:resultListener:1018
[task 2020-06-11T04:24:24.872Z] 04:24:24     INFO - resource://gre/modules/ExtensionCommon.jsm:emit:327
[task 2020-06-11T04:24:24.872Z] 04:24:24     INFO - resource://gre/modules/Extension.jsm:receiveMessage:1961
[task 2020-06-11T04:24:24.872Z] 04:24:24     INFO - MessageListener.receiveMessage*resource://gre/modules/Extension.jsm:Extension:1781
[task 2020-06-11T04:24:24.873Z] 04:24:24     INFO - resource://testing-common/ExtensionTestCommon.jsm:generate:473
[task 2020-06-11T04:24:24.873Z] 04:24:24     INFO - resource://specialpowers/SpecialPowersParent.jsm:receiveMessage:1015
[task 2020-06-11T04:24:24.873Z] 04:24:24     INFO - JSActor query*resource://specialpowers/SpecialPowersChild.jsm:loadExtension:2149
[task 2020-06-11T04:24:24.873Z] 04:24:24     INFO - chrome://mochikit/content/tests/SimpleTest/ExtensionTestUtils.js:ExtensionTestUtils.loadExtension:113
[task 2020-06-11T04:24:24.874Z] 04:24:24     INFO - chrome://mochitests/content/browser/browser/components/extensions/test/browser/browser_ext_tabs_cookieStoreId.js:null:79
[task 2020-06-11T04:24:24.874Z] 04:24:24     INFO - chrome://mochikit/content/browser-test.js:Tester_execTest/<:1064
[task 2020-06-11T04:24:24.874Z] 04:24:24     INFO - chrome://mochikit/content/browser-test.js:Tester_execTest:1104
[task 2020-06-11T04:24:24.874Z] 04:24:24     INFO - chrome://mochikit/content/browser-test.js:nextTest/<:927
[task 2020-06-11T04:24:24.874Z] 04:24:24     INFO - chrome://mochikit/content/tests/SimpleTest/SimpleTest.js:SimpleTest.waitForFocus/waitForFocusInner/focusedOrLoaded/<:918
[task 2020-06-11T04:25:51.856Z] 04:25:51     INFO - Not taking screenshot here: see the one that was previously logged
[task 2020-06-11T04:25:51.857Z] 04:25:51     INFO - TEST-UNEXPECTED-FAIL | browser/components/extensions/test/browser/browser_ext_tabs_cookieStoreId.js | Test timed out - 
[task 2020-06-11T04:25:51.859Z] 04:25:51     INFO - Not taking screenshot here: see the one that was previously logged
[task 2020-06-11T04:25:51.859Z] 04:25:51     INFO - TEST-UNEXPECTED-FAIL | browser/components/extensions/test/browser/browser_ext_tabs_cookieStoreId.js | no tasks awaiting on messages - Got ["test-done"], expected []
[task 2020-06-11T04:25:51.860Z] 04:25:51     INFO - Stack trace:
[task 2020-06-11T04:25:51.861Z] 04:25:51     INFO - chrome://mochikit/content/browser-test.js:test_is:1327
[task 2020-06-11T04:25:51.863Z] 04:25:51     INFO - chrome://mochikit/content/tests/SimpleTest/ExtensionTestUtils.js:ExtensionTestUtils.loadExtension/<:36
[task 2020-06-11T04:25:51.863Z] 04:25:51     INFO - chrome://mochikit/content/browser-test.js:nextTest:550
[task 2020-06-11T04:25:51.864Z] 04:25:51     INFO - chrome://mochikit/content/browser-test.js:timeoutFn:1190
[task 2020-06-11T04:25:51.865Z] 04:25:51     INFO - setTimeout handler*chrome://mochikit/content/browser-test.js:Tester_execTest:1137
[task 2020-06-11T04:25:51.867Z] 04:25:51     INFO - chrome://mochikit/content/browser-test.js:nextTest/<:927
[task 2020-06-11T04:25:51.868Z] 04:25:51     INFO - chrome://mochikit/content/tests/SimpleTest/SimpleTest.js:SimpleTest.waitForFocus/waitForFocusInner/focusedOrLoaded/<:918
[task 2020-06-11T04:25:51.868Z] 04:25:51     INFO - Not taking screenshot here: see the one that was previously logged
[task 2020-06-11T04:25:51.869Z] 04:25:51     INFO - TEST-UNEXPECTED-FAIL | browser/components/extensions/test/browser/browser_ext_tabs_cookieStoreId.js | Extension left running at test shutdown - 
[task 2020-06-11T04:25:51.870Z] 04:25:51     INFO - Stack trace:
[task 2020-06-11T04:25:51.871Z] 04:25:51     INFO - chrome://mochikit/content/browser-test.js:test_ok:1299
[task 2020-06-11T04:25:51.871Z] 04:25:51     INFO - chrome://mochikit/content/tests/SimpleTest/ExtensionTestUtils.js:ExtensionTestUtils.loadExtension/<:117
[task 2020-06-11T04:25:51.872Z] 04:25:51     INFO - chrome://mochikit/content/browser-test.js:nextTest:550
[task 2020-06-11T04:25:51.872Z] 04:25:51     INFO - chrome://mochikit/content/browser-test.js:timeoutFn:1190
[task 2020-06-11T04:25:51.873Z] 04:25:51     INFO - setTimeout handler*chrome://mochikit/content/browser-test.js:Tester_execTest:1137
[task 2020-06-11T04:25:51.874Z] 04:25:51     INFO - chrome://mochikit/content/browser-test.js:nextTest/<:927
[task 2020-06-11T04:25:51.874Z] 04:25:51     INFO - chrome://mochikit/content/tests/SimpleTest/SimpleTest.js:SimpleTest.waitForFocus/waitForFocusInner/focusedOrLoaded/<:918
[task 2020-06-11T04:25:51.909Z] 04:25:51     INFO - GECKO(1263) | MEMORY STAT | vsize 20976380MB | residentFast 2215MB
[task 2020-06-11T04:25:51.910Z] 04:25:51     INFO - TEST-OK | browser/components/extensions/test/browser/browser_ext_tabs_cookieStoreId.js | took 90071ms
[task 2020-06-11T04:25:51.970Z] 04:25:51     INFO - checking window state
[task 2020-06-11T04:25:51.971Z] 04:25:51     INFO - Not taking screenshot here: see the one that was previously logged
[task 2020-06-11T04:25:51.972Z] 04:25:51     INFO - TEST-UNEXPECTED-FAIL | browser/components/extensions/test/browser/browser_ext_tabs_cookieStoreId.js | Found a browser window after previous test timed out - 
[task 2020-06-11T04:25:51.972Z] 04:25:51     INFO - Not taking screenshot here: see the one that was previously logged
[task 2020-06-11T04:25:51.972Z] 04:25:51     INFO - TEST-UNEXPECTED-FAIL | browser/components/extensions/test/browser/browser_ext_tabs_cookieStoreId.js | Found a browser window after previous test timed out - 
[task 2020-06-11T04:25:51.972Z] 04:25:51     INFO - GECKO(1263) | must wait for focus
Flags: needinfo?(deeps.karanji2)

The failure log contains a very relevant message that triggers the failure. You can find the immediate reason for the test failure by looking for the line containing "UNEXPECTED-FAIL". From that you will learn the test file that failed, and an error message/reason. Often test failures are not directly caused by the reported TEST-UNEXPECTED-FAIL reason, but by something unexpected that happened before. So if the error message doesn't immediately make sense, read the log output backwards starting from the FIRST line containing "TEST-UNEXPECTED-FAIL".

If you look at the log, the cause of the test failure will probably be obvious (and its relation to your patch).
Run the test locally to confirm the test failure, fix the issue and run the test again to verify the fix.

Flags: needinfo?(rob)
Flags: needinfo?(deeps.karanji2)
Attachment #9154492 - Attachment description: Bug 1637431 - Gives meaningful tabs.query error message. r=robwu → Bug 1637431 - Removed a comment line, rev approved. r=robwu
Attachment #9154492 - Attachment description: Bug 1637431 - Removed a comment line, rev approved. r=robwu → Bug 1637431 - Gives meaningful tabs.query error message. r=robwu
Pushed by ccoroiu@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/73c8aa87664e Gives meaningful tabs.query error message. r=robwu,geckoview-reviewers,agi
Status: ASSIGNED → RESOLVED
Closed: 5 years ago
Resolution: --- → INVALID

Eh, if anything it's "RESOLVED FIXED", not "RESOLVD INVALID".

You don't have to change the status though - when the code is merged from autoland with mozilla-central the bug will automatically be updated with a comment (including links to the commit on mozilla-central), together with a version in which this is fixed.

Status: RESOLVED → REOPENED
Resolution: INVALID → ---
Status: REOPENED → RESOLVED
Closed: 5 years ago5 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla79
Pushed by geoff@darktrojan.net: https://hg.mozilla.org/comm-central/rev/b5ab548ce391 Port bug 1637431 - Gives meaningful tabs.query error message. rs=bustage-fix
See Also: → 1654524
See Also: → 1654833
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: