Closed Bug 1743079 Opened 2 years ago Closed 2 years ago

testhawkrequest.js fails with socketprocess if the permission manager is lazily initialized

Categories

(Core :: Networking, defect, P2)

defect

Tracking

()

RESOLVED FIXED
97 Branch
Tracking Status
firefox97 --- fixed

People

(Reporter: jstutte, Assigned: kershaw)

References

Details

(Whiteboard: [necko-triaged])

Attachments

(1 file)

In bug 1707963 we are re-introducing lazy initialization for the permission manager. It seems that this triggers a failure in testhawkrequest.js if run with socket process enabled. The test is deactivated there but we should understand the root cause.

Flags: needinfo?(kershaw)
See Also: → 1707963

I also encountered this failure when enabling xpcshell tests on windows with socket process.
https://treeherder.mozilla.org/logviewer?job_id=360575413&repo=try&lineNumber=6035

[task 2021-12-08T16:23:26.549Z] 16:23:26     INFO -  TEST-PASS | services/common/tests/unit/test_hawkrequest.js | test_hawk_authenticated_request - [test_hawk_authenticated_request : 150] 200 == 200
[task 2021-12-08T16:23:26.550Z] 16:23:26     INFO -  TEST-PASS | services/common/tests/unit/test_hawkrequest.js | test_hawk_authenticated_request - [test_hawk_authenticated_request : 151] "yay" == "yay"
[task 2021-12-08T16:23:26.550Z] 16:23:26  WARNING -  TEST-UNEXPECTED-FAIL | services/common/tests/unit/test_hawkrequest.js | test_hawk_authenticated_request - [test_hawk_authenticated_request : 158] "zu-NP" != "zu-NP"

The failure is at this line.
It shows that after calling Services.prefs.resetUserPrefs, the pref value is not cleared.
After digging into it, I found that the reason is that when launching socket process, Preferences::EnsureSnapshot is called and the hash table is cleared here.
When Preferences::ResetUserPrefs is called after Preferences::EnsureSnapshot, the hash table is empty and we failed to clear the user pref.

Flags: needinfo?(kershaw)
Assignee: nobody → kershaw
Severity: -- → S4
Priority: -- → P2
Whiteboard: [necko-triaged]

As a workaround, I think we can replace resetUserPrefs in test_hawkrequest.js with clearUserPref.
Actually, it seems that resetUserPrefs is only used in this test, so I think we can stop exposing this function to js to prevent someone hit this issue in the future.

Pushed by kjang@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/757d5a9de5a3
Remove ResetUserPrefs(), r=KrisWright
Status: NEW → RESOLVED
Closed: 2 years ago
Resolution: --- → FIXED
Target Milestone: --- → 97 Branch

Hi Kershaw, I assume I need to remove the (not-yet-landed) changes from https://phabricator.services.mozilla.com/D132088 to this test then?

Flags: needinfo?(kershaw)

(In reply to Jens Stutte [:jstutte] from comment #7)

Hi Kershaw, I assume I need to remove the (not-yet-landed) changes from https://phabricator.services.mozilla.com/D132088 to this test then?

Yes, could you try this and let me know if the test is passed?
Thanks!

Flags: needinfo?(kershaw)

(In reply to Kershaw Chang [:kershaw] from comment #8)

Yes, could you try this and let me know if the test is passed?

On its way: https://treeherder.mozilla.org/#/jobs?repo=try&revision=b3a9f8cc2f261056096a5109e0fd738c05774e23

Edit: that build was totally broken, sorry.

You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: