Closed Bug 1587199 Opened 5 years ago Closed 5 years ago

netwerk/test/unit/test_parse_content_type.js fails when run as part of the Thunderbird Xpcshell tests

Categories

(Core :: DOM: Core & HTML, defect, P2)

defect

Tracking

()

RESOLVED FIXED
mozilla71
Tracking Status
firefox71 --- fixed

People

(Reporter: jorgk-bmo, Assigned: benc)

References

(Regression)

Details

(Keywords: regression)

Attachments

(1 file, 2 obsolete files)

+++ This bug was initially created as a clone of Bug #1531405 +++

This is similar to bug 1582086 and bug 1585193. The answer is to switch the tests off:
https://searchfox.org/mozilla-central/rev/7cc0f0e89cb40e43bf5c96906f13d44705401042/toolkit/components/search/tests/xpcshell/xpcshell-legacyconfig.ini#66

According to Mark Banner (bug 1582086 comment #1) the tests fail since TB doesn't have telemetry, but in fact it's ought to have since bug 1427877.

Ben, can you please take a look what's going on here. We can't go around switching off tests here and there.

Flags: needinfo?(benc)

It's a case of a test relying on a telemetry probe which isn't enabled under Thunderbird (The histogram definition for NETWORK_CROSS_ORIGIN_STYLESHEET_CONTENT_TYPE doesn't include "thunderbird" in it's "products" list).

The perfect opportunity to try out the new bypass-the-product-check-for-testing preference flag that Chris added in Bug 1579752!
The attached patch works for me, although I'm not so happy about how verbose it is. I think it's likely that quite a few more of these cases will pop up over time, so it'd be nice to keep the pref twiddling code nice and unobtrusive. Improvement ideas most welcome!

Flags: needinfo?(benc)

Bugbug thinks this bug is a defect, but please change it back in case of error.

Type: enhancement → defect
Attachment #9099690 - Attachment is obsolete: true

Thanks for the comments, Valentin. I'm unsure whether to land the approved revision with the toolkit.telemetry.testing.overrideProductsCheck pref, which seems to be there for the purpose, or do the subtest disabling the "classic way" with { skip_if: () => AppConstants.MOZ_APP_NAME == "thunderbird" }.

I'll let you guys work it out.

Since you already wrote it I guess we can go ahead and land it. The probe will expire in a few releases anyway, so we'll have to remove the test eventually.

I hope someone ran linting in this ;-) - Landed it now.

Pushed by mozilla@jorgk.com: https://hg.mozilla.org/integration/autoland/rev/51e2dc221801 Fix test_parse_content_type.js under Thunderbird. r=valentin

Slightly more concise version for the json_cache_... tests.
I suspect the registerCleanupFunction() bit could be ditched (each test file gets it's own profile dir, and thus it's own prefs, right?).
But it seemed more polite to clean up the preference once done.

jorgk: I did run eslint over the previous patch (and this new one).

Status: NEW → RESOLVED
Closed: 5 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla71
Assignee: nobody → benc
Attachment #9100014 - Attachment is obsolete: true
Has Regression Range: --- → yes
Keywords: regression
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: