test_telemetryController.js fails on Android with GPU process enabled
Categories
(GeckoView :: Sandboxing, defect)
Tracking
(firefox98 fixed)
Tracking | Status | |
---|---|---|
firefox98 | --- | fixed |
People
(Reporter: jnicol, Assigned: jnicol)
References
Details
Attachments
(1 file)
(deleted),
text/x-phabricator-request
|
Details |
The test test_telemetryEnabledUnexpectedValue
fails with the following warning and error message:
WARNING: Rejected attempt to change type of pref toolkit.telemetry.enabled's user value from bool to string: file /home/jamie/src/gecko/modules/libpref/Preferences.cpp:1668
...
FAIL toolkit/components/telemetry/tests/unit/test_TelemetryController.js - xpcshell return code: 0
ERROR Unexpected exception NS_ERROR_UNEXPECTED: Component returned failure code: 0x8000ffff (NS_ERROR_UNEXPECTED) [nsIPrefBranch.setStringPref]
Preferences._set@resource://gre/modules/Preferences.jsm:126:24
Preferences.set@resource://gre/modules/Preferences.jsm:115:8
test_telemetryEnabledUnexpectedValue@test_TelemetryController.js:633:17
_run_next_test/<@/data/local/tmp/test_root/xpc/head.js:1673:22
_run_next_test@/data/local/tmp/test_root/xpc/head.js:1673:38
run@/data/local/tmp/test_root/xpc/head.js:819:9
_do_main@/data/local/tmp/test_root/xpc/head.js:240:6
_execute_test@/data/local/tmp/test_root/xpc/head.js:604:5
@-e:1:1
This test only runs on android because we skip it if toolkit.telemetry.unified
is true.
The test starts by calling defaultPrefBranch.deleteBranch(TelemetryUtils.Preferences.TelemetryEnabled)
to delete the existing pref. It then attempts to set the telemetry enabled pref to a string value. It then asserts that telemetry is disabled because the pref is invalid (because it's a string).
However, we can see from the warning that we encountered an error when setting the pref to a string, because the pref already exists as a bool.
We can see that deleteBranch()
successfully removes the pref from HashTable()
here. However, in the subsequent pref_SetPref()
call we find an existing pref here in gSharedMap
. It doesn't matter that we deleted the pref from HashTable()
as we don't even look that up if we find the pref in gSharedMap
first.
If the GPU process is disabled then gSharedMap
is null. This means we look up the pref in HashTable()
, where it has indeed been deleted from. Meaning we cannot find an existing pref, and can therefore successfully set it to a string.
But if the GPU process is enabled then gSharedMap
is non-null due to this call, which calls through to here.
It doesn't seem to me like the GPU process is doing anything wrong here - the other process host types also call SerializeToSharedMemory()
- I think we just happen to be the only one launched by xpcshell tests on Android. What I'm unsure of is whether the test is relying on invalid behaviour, assuming that it can successfully delete a pref. Or whether the preference code should be allowing it to do that.
Kris and Chris, any ideas how to proceed with this? I see you are both active in Preferences.cpp and test_TelemetryController.js respectively, but please forward the needinfo on if there's someone who'd be better able to answer!
Comment 1•3 years ago
|
||
(In reply to Jamie Nicol [:jnicol] from comment #0)
This test only runs on android because we skip it if
toolkit.telemetry.unified
is true.
Oh, well, let me stop you there. Non-unified Telemetry is not a supported codepath now that Fennec is no more. It would have been removed as part of defennecstration bug 1577863 if that work had been assigned sufficient priority.
You may remove the test.
Assignee | ||
Comment 2•3 years ago
|
||
This test attempts to set a pref to a value of the wrong type. Prior
to doing so it must delete the existing pref, else we get an error
about changing the pref's type. This failed when we enable the GPU
process on Android, as we are unable to delete the existing pref when
using a shared pref map.
But luckily this test only runs when toolkit.telemetry.unified=false,
which is no longer a supported codepath in this post-fennec world. So
we can simply remove the test.
Updated•3 years ago
|
Comment 4•3 years ago
|
||
bugherder |
Comment 5•2 years ago
|
||
Moving GPU process bugs to the new GeckoView::Sandboxing component.
Description
•