testhawkrequest.js fails with socketprocess if the permission manager is lazily initialized
Categories
(Core :: Networking, defect, P2)
Tracking
()
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.
Assignee | ||
Comment 1•2 years ago
|
||
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.
Assignee | ||
Updated•2 years ago
|
Assignee | ||
Comment 2•2 years ago
|
||
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.
Assignee | ||
Comment 3•2 years ago
|
||
Pushed by kjang@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/757d5a9de5a3 Remove ResetUserPrefs(), r=KrisWright
Comment 5•2 years ago
|
||
bugherder |
Comment 6•2 years ago
|
||
bugherder |
Reporter | ||
Comment 7•2 years ago
|
||
Hi Kershaw, I assume I need to remove the (not-yet-landed) changes from https://phabricator.services.mozilla.com/D132088 to this test then?
Assignee | ||
Comment 8•2 years ago
|
||
(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!
Reporter | ||
Comment 9•2 years ago
•
|
||
(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.
Description
•