Newtab browser tests throw "AboutNewTab.activityStream is null" during setup
Categories
(Firefox :: New Tab Page, defect)
Tracking
()
| Tracking | Status | |
|---|---|---|
| firefox158 | --- | fixed |
People
(Reporter: florian, Assigned: florian)
References
(Blocks 1 open bug)
Details
Attachments
(2 external files)
Two tests in browser/extensions/newtab/test/browser read AboutNewTab.activityStream during setup and throw can't access property "store", AboutNewTab.activityStream is null: browser_SmartShortcuts.js and browser_activation_window.js.
AboutNewTab.onBrowserReady() assigns activityStream only after awaiting ProfileAge, the newtabTrainhop Nimbus feature and promiseBuiltInAddonInitialized. Neither test awaits AboutNewTab.activityStreamPromise, which exists for exactly this and is what AboutNewTabParent awaits before touching activityStream.
It is not a narrow race: in the one failing job carrying a profile, onBrowserReady() was dispatched at t=1.4 s and stayed in that Promise.all until 6.3 s after all three SmartShortcuts tasks had failed, with activityStream null across three test files and 12 tasks. What delays it is unestablished -- ExperimentAPI.#init() logs its first migration 9 ms before the Promise.all releases, but that is co-timing between two log paths, not a measurement.
Fix: await activityStreamPromise in each setup. browser_activation_window.js also awaits AboutNewTab.activityStream.initialized, a plain boolean, and prefsFeed.store.initialized, which the newtab Store does not define -- both read as readiness waits and neither waits, so both go.
| Assignee | ||
Comment 1•1 month ago
|
||
Every task reads AboutNewTab.activityStream, which onBrowserReady() assigns
only after its startup awaits, and enrolls without waiting for
ExperimentManager.onStartup(). The ExperimentAPI.ready() calls dropped here
were no-ops, since NimbusTestUtils.enroll() already awaits store.ready()
itself.
The skip-if is from the bug 1995208 sweep and meant a bare "verify", which
passes on an unmodified tree.
Updated•1 month ago
|
| Assignee | ||
Comment 2•1 month ago
|
||
The setup read AboutNewTab.activityStream before onBrowserReady() had assigned
it: the await it replaces was on ActivityStream.initialized, a plain boolean,
so it never waited for anything. The await on prefsFeed.store.initialized goes
for the same reason, the newtab Store not defining it.
Comment 4•1 month ago
|
||
| bugherder | ||
https://hg.mozilla.org/mozilla-central/rev/98258f051ec3
https://hg.mozilla.org/mozilla-central/rev/17d368417567
Updated•1 month ago
|
Description
•