Open Bug 1769184 Opened 2 years ago Updated 26 days ago

consider modifying xpcshell tests to support a conditioned profile

Categories

(WebExtensions :: Untriaged, enhancement, P3)

enhancement

Tracking

(Not tracked)

People

(Reporter: jmaher, Unassigned)

References

Details

probably not a high priority, but we are working towards getting tests running in CI that have a more complete profile that is updated daily. Many tests are written assuming a fresh/blank profile.

browser/components/extensions/test/xpcshell/
test_ext_bookmarks.js
test_ext_topSites.js
test_ext_urlbar.js
toolkit/mozapps/extensions/test/xpcshell/
test_XPIStates.js
test_shutdown_early.js
test_sideloads_after_rebuild.js
test_system_upgrades.js
test_systemaddomstartupprefs.js
test_update_isPrivileged.js
toolkit/components/extensions/test/xpcshell/
test_ExtensionStorageSync_migration_kinto.js
test_ext_schemas_manifest_permissions.js
test_ext_schemas_privileged.js
test_ext_startup_cache_telemetry.js
test_extension_permissions_migration.js

The Bugbug bot thinks this bug should belong to the 'Core::Gecko Profiler' component, and is moving the bug to that component. Please correct in case you think the bot is wrong.

Component: Untriaged → Gecko Profiler
Product: WebExtensions → Core

Sorry Bugbug, I think the "profiles" in the description refer to Firefox user profiles, not Gecko Profiler profiles.
Moving bug back to the WebExternsions product.

Component: Gecko Profiler → Untriaged
Product: Core → WebExtensions
Depends on: 1783828

What many of these tests have in common is that they involve updated extension schemas.
I suspect that the schema updated are not correctly processed because part of the schemas / registrations are stored in StartupCache.

In bug 1783828, I have shown that the consequence of this is that any change to an extension API schema is going to result in a test failure, and that the failure may disappear once the conditioned profile has been updated in 1~2 days. E.g. because of:

This is a condprof test-only issue. In Firefox, the StartupCache is wiped whenever a new version is released. That logic is triggered from https://searchfox.org/mozilla-central/rev/c0bed29d643393af6ebe77aa31455f283f169202/toolkit/xre/nsAppRunner.cpp#5178-5181, e.g. wiped when the app version info in the profile directory's compatibility.ini does not match the application version. The caller of this is ultimately XRE_main, which is called by Firefox on desktop and Android, but not by xpcshell (XRE_XPCShellMain).

To test whether the startupcache may be affecting test results, run the condprof tests with MOZ_PURGE_CACHES=1 environment variable to forcibly clear the caches.

See Also: → 1757168
Severity: -- → N/A
Priority: -- → P3
Depends on: 1795285
See Also: → 1878264
You need to log in before you can comment on or make changes to this bug.