The default bug view has changed. See this FAQ.

TEST-UNEXPECTED-FAIL | uriloader/exthandler/tests/unit/test_handlerService_json.js - TEST-UNEXPECTED-FAIL | uriloader/exthandler/tests/unit/test_handlerService_rdf.js

RESOLVED FIXED in Thunderbird 55.0

Status

Thunderbird
Installer
RESOLVED FIXED
10 days ago
8 days ago

People

(Reporter: Jorg K (GMT+1), Assigned: Jorg K (GMT+1))

Tracking

unspecified
Thunderbird 55.0

Firefox Tracking Flags

(Not tracked)

Details

(Whiteboard: [Thunderbird-testfailure: X all])

Attachments

(1 attachment, 1 obsolete attachment)

(Assignee)

Description

10 days ago
+++ This bug was initially created as a clone of Bug #1347540 +++

TEST-UNEXPECTED-FAIL | uriloader/exthandler/tests/unit/test_handlerService_json.js | xpcshell return code: 0
TEST-UNEXPECTED-FAIL | uriloader/exthandler/tests/unit/test_handlerService_rdf.js | xpcshell return code: 0

Alphan and Paolo:
These need tests are failing in the Thunderbird Xpcshell test suite. Please take a look at
https://archive.mozilla.org/pub/thunderbird/tinderbox-builds/comm-central-win32/1489587756/comm-central_win7_ix_test-xpcshell-bm110-tests1-windows-build12.txt.gz
searching for TEST-UNEXPECTED-FAIL. There are plenty of errors logged, more than would make sense to paste here.

How could we get these tests to pass or should we just disable them for Thunderbird.
Flags: needinfo?(paolo.mozmail)
Flags: needinfo?(alchen)
Failed log:

(test_handlerService_json.js)
08:53:00     INFO -  TEST-PASS | uriloader/exthandler/tests/unit/test_handlerService_json.js | testIsInHandlerArray - [testIsInHandlerArray : 320] 0 == 0
08:53:00     INFO -  PID 10148 | JavaScript error: resource://gre/components/nsHandlerService-json.js, line 235: NS_ERROR_NOT_AVAILABLE: handlerSvc fillHandlerInfo: don't know this type
08:53:00     INFO -  Unexpected exception NS_ERROR_NOT_AVAILABLE: handlerSvc fillHandlerInfo: don't know this type
08:53:00     INFO -  fillHandlerInfo@resource://gre/components/nsHandlerService-json.js:235:13
08:53:00     INFO -  testIsInHandlerArray@C:/slave/test/build/tests/xpcshell/tests/uriloader/exthandler/tests/unit/test_handlerService_json.js -> file:///C:/slave/test/build/tests/xpcshell/tests/uriloader/exthandler/tests/unit/common_test_handlerService.js:321:3

(test_handlerService_rdf.js)
08:53:01     INFO -  TEST-PASS | uriloader/exthandler/tests/unit/test_handlerService_rdf.js | testIsInHandlerArray - [testIsInHandlerArray : 320] 0 == 0
08:53:01     INFO -  PID 10268 | JavaScript error: resource://gre/components/nsHandlerService.js, line 324: NS_ERROR_NOT_AVAILABLE: handlerSvc fillHandlerInfo: don't know this type
08:53:01     INFO -  Unexpected exception NS_ERROR_NOT_AVAILABLE: handlerSvc fillHandlerInfo: don't know this type
08:53:01     INFO -  HS_fillHandlerInfo@resource://gre/components/nsHandlerService.js:324:13
08:53:00     INFO -  testIsInHandlerArray@C:/slave/test/build/tests/xpcshell/tests/uriloader/exthandler/tests
08:53:01     INFO -  testIsInHandlerArray@C:/slave/test/build/tests/xpcshell/tests/uriloader/exthandler/tests/unit/test_handlerService_rdf.js -> file:///C:/slave/test/build/tests/xpcshell/tests/uriloader/exthandler/tests/unit/common_test_handlerService.js:321:3
Flags: needinfo?(paolo.mozmail)
Flags: needinfo?(alchen)
> file:///C:/slave/test/build/tests/xpcshell/tests/uriloader/exthandler/tests/
> unit/common_test_handlerService.js:321:3

@common_test_handlerService.js:321
gHandlerService.fillHandlerInfo(protoInfo, "ircs");


Two failed cases are the same.
When doing fillHandlerInfo with overrideType "ircs", the handler service didn't know this type.

In Firefox, irc handler info will be injected by injectNewDefaults().
http://searchfox.org/mozilla-central/source/uriloader/exthandler/nsHandlerService.js#143
http://searchfox.org/mozilla-central/source/uriloader/exthandler/nsHandlerService-json.js#68

If Thunderbird doesn't do the injection, I think you can just pass this test as what we did on Fennec.
http://searchfox.org/mozilla-central/source/uriloader/exthandler/tests/unit/common_test_handlerService.js#312
There is another way to solve this.

Since you can pass the test "testReloadWithoutDB", I think you can also use the preference "defaultHandlersVersion" to do the check at the beginning of the test "testIsInHandlerArray".
You can add a check and do an early return if the preference does not exist.

  if (!Services.prefs.getPrefType("gecko.handlerService.defaultHandlersVersion")){
    return;
  }
(Assignee)

Comment 4

10 days ago
Thank you for your answer. How about just adding those preferences to TB?
pref("gecko.handlerService.defaultHandlersVersion", "chrome://browser-region/locale/region.properties");
and many more.

Let's try this here:
https://treeherder.mozilla.org/#/jobs?repo=try-comm-central&revision=3e79665f518dfb1c8b4f672fb6d9dccbed30c2ec
(Assignee)

Comment 5

10 days ago
That made it even worse:
https://treeherder.mozilla.org/#/jobs?repo=try-comm-central&selectedJob=84234986

https://archive.mozilla.org/pub/thunderbird/try-builds/mozilla@jorgk.com-3e79665f518dfb1c8b4f672fb6d9dccbed30c2ec/try-comm-central-macosx64/try-comm-central_yosemite_r7_test-xpcshell-bm134-tests1-macosx-build7.txt.gz

So next I'll try disabling according to comment #3.
(Assignee)

Comment 6

10 days ago
https://treeherder.mozilla.org/#/jobs?repo=try-comm-central&revision=925ebfcc7eff691a2ee23d816d99280427f882fb
(In reply to Jorg K (GMT+1) from comment #4)
> Thank you for your answer. How about just adding those preferences to TB?
> pref("gecko.handlerService.defaultHandlersVersion",
> "chrome://browser-region/locale/region.properties");
> and many more.
> 
If you want to injectDefault as Firefox, you need to add more preferences.
"gecko.handlerService.defaultHandlersVersion" is not the only one.
You can check the following for more detail.
http://searchfox.org/mozilla-central/source/browser/app/profile/firefox.js#731
(Assignee)

Comment 8

10 days ago
I tried two things:

First, I added a lot of preferences and got a failure, see comment #5:
https://treeherder.mozilla.org/#/jobs?repo=try-comm-central&selectedJob=84234986
Sorry about all the other failures, but you can see that test_handlerService.js and friends still failed.
Here are all the preferences I added, which one did I miss?
https://hg.mozilla.org/try-comm-central/rev/d713d1e9d1eedb90dd68c303c6915fe749d9da31

In the next try I did what you had suggested in comment #3, that stopped the failures, so let's go with this.
(Assignee)

Comment 9

10 days ago
Created attachment 8848076 [details] [diff] [review]
1347687-skip-test.patch

Solution suggested in comment #3. Or should I replace the
   if (Services.appinfo.widgetToolkit == "android") {
     do_print("Skipping test because it does not apply to this platform.");
     return;
   }
with the new test?
Assignee: nobody → jorgk
Status: NEW → ASSIGNED
Attachment #8848076 - Flags: review?(alchen)
(Assignee)

Comment 10

9 days ago
Comment on attachment 8848076 [details] [diff] [review]
1347687-skip-test.patch

Sorry, I didn't see that this failure *hadn't* gone away since there were to many other failures in that try run. Looking again here:
https://treeherder.mozilla.org/#/jobs?repo=try-comm-central&selectedJob=84249183
we still have:

TEST-UNEXPECTED-FAIL | uriloader/exthandler/tests/unit/test_handlerService_json.js | xpcshell return code: 0
TEST-UNEXPECTED-FAIL | uriloader/exthandler/tests/unit/test_handlerService_json.js | testFillHandlerInfoForProtocol - [testFillHandlerInfoForProtocol : 377] false == true
TEST-UNEXPECTED-FAIL | uriloader/exthandler/tests/unit/test_handlerService_rdf.js | xpcshell return code: 0
TEST-UNEXPECTED-FAIL | uriloader/exthandler/tests/unit/test_handlerService_rdf.js | testFillHandlerInfoForProtocol - [testFillHandlerInfoForProtocol : 377] false == true

That's with the additional
+  if (!Services.prefs.getPrefType("gecko.handlerService.defaultHandlersVersion")) {
+    do_print("Skipping test: No pref gecko.handlerService.defaultHandlersVersion.");
+    return;
+  }
in testIsInHandlerArray().
Attachment #8848076 - Flags: review?(alchen)
(Assignee)

Comment 11

9 days ago
Created attachment 8848097 [details] [diff] [review]
1347687-skip-test.patch (v2)

Sorry, skipping the test needed to be added twice. Now the test "passes" locally.
Attachment #8848076 - Attachment is obsolete: true
Attachment #8848097 - Flags: review?(alchen)
Comment on attachment 8848097 [details] [diff] [review]
1347687-skip-test.patch (v2)

Review of attachment 8848097 [details] [diff] [review]:
-----------------------------------------------------------------

LGTM
Attachment #8848097 - Flags: review?(alchen) → review+
(Assignee)

Comment 13

9 days ago
Hi Tomcat, this needs to be landed on M-C/M-I. I didn't want to move the bug to an M-C product/component, so I'm setting NI so you can pick it up. Thank you in advance.
Flags: needinfo?(cbook)
Keywords: checkin-needed

Comment 14

9 days ago
Pushed by cbook@mozilla.com:
https://hg.mozilla.org/integration/mozilla-inbound/rev/d913a0c7d25a
Skip test if pref gecko.handlerService.defaultHandlersVersion not defined. r=alchen
Keywords: checkin-needed
landed :)
Flags: needinfo?(cbook)

Comment 16

8 days ago
bugherder
https://hg.mozilla.org/mozilla-central/rev/d913a0c7d25a
Status: ASSIGNED → RESOLVED
Last Resolved: 8 days ago
Resolution: --- → FIXED
Target Milestone: --- → Thunderbird 55.0
You need to log in before you can comment on or make changes to this bug.