Closed Bug 1552538 Opened 1 year ago Closed 1 year ago

Intermittent browser/components/newtab/test/browser/browser_asrouter_trigger_listeners.js | A promise chain failed to handle a rejection: win.ownerGlobal.gBrowser is undefined - stack: get hasPinnedTabs@resource://activity-stream/lib/ASRouterTargeting.jsm

Categories

(Firefox :: New Tab Page, defect, P1)

defect

Tracking

()

RESOLVED FIXED
Firefox 68
Iteration:
69.1 - May 13 - 26
Tracking Status
firefox-esr60 --- unaffected
firefox67 --- unaffected
firefox68 --- fixed

People

(Reporter: intermittent-bug-filer, Assigned: Mardak)

References

(Regression)

Details

(Keywords: intermittent-failure, regression)

Attachments

(1 file)

Filed by: nbeleuzu [at] mozilla.com
Parsed log: https://treeherder.mozilla.org/logviewer.html#?job_id=247060949&repo=autoland
Full log: https://queue.taskcluster.net/v1/task/O66mlZQeTs20BPOfWfIEgQ/runs/0/artifacts/public/logs/live_backing.log


15:44:47 INFO - Console message: [JavaScript Error: "Unexpected content-type "text/html;charset=utf-8"" {file: "resource://services-settings/Utils.jsm" line: 91}]
15:44:47 INFO - fetchLatestChanges@resource://services-settings/Utils.jsm:91:15
15:44:47 INFO - asyncsync@resource://services-settings/RemoteSettingsClient.jsm:256:37
15:44:47 INFO - get@resource://services-settings/RemoteSettingsClient.jsm:218:22
15:44:47 INFO - async
_getRemoteSettingsMessages@resource://activity-stream/lib/ASRouter.jsm:238:35
15:44:47 INFO - _remoteSettingsLoader@resource://activity-stream/lib/ASRouter.jsm:225:45
15:44:47 INFO - loadMessagesForProvider@resource://activity-stream/lib/ASRouter.jsm:294:26
15:44:47 INFO - loadMessagesFromAllProviders@resource://activity-stream/lib/ASRouter.jsm:533:74
15:44:47 INFO - async*onPrefChange@resource://activity-stream/lib/ASRouter.jsm:428:18
15:44:47 INFO - observe/<@resource://activity-stream/lib/ASRouterPreferences.jsm:134:35
15:44:47 INFO - observe@resource://activity-stream/lib/ASRouterPreferences.jsm:134:21
15:44:47 INFO - _receiveMessageAPI@chrome://mochikit/content/tests/SimpleTest/SpecialPowersObserverAPI.js:356:26
15:44:47 INFO - ChromePowers.prototype._receiveMessage@chrome://mochikit/content/tests/SimpleTest/ChromePowers.js:81:30
15:44:47 INFO - ChromePowers.prototype._sendSyncMessage@chrome://mochikit/content/tests/SimpleTest/ChromePowers.js:38:16
15:44:47 INFO - _setPref@chrome://mochikit/content/tests/SimpleTest/specialpowersAPI.js:1409:17
15:44:47 INFO - _applyPrefs@chrome://mochikit/content/tests/SimpleTest/specialpowersAPI.js:1248:14
15:44:47 INFO - _applyPrefs/onPrefActionsApplied/<@chrome://mochikit/content/tests/SimpleTest/specialpowersAPI.js:1227:14
15:44:47 INFO - notify@resource://gre/modules/Timer.jsm:43:17
15:44:47 INFO -
15:44:47 INFO - Console message: [JavaScript Error: "TypeError: win.ownerGlobal.gBrowser is undefined" {file: "resource://activity-stream/lib/ASRouterTargeting.jsm" line: 304}]
15:44:47 INFO - Console message: [JavaScript Error: "TypeError: win.ownerGlobal.gBrowser is undefined" {file: "resource://activity-stream/lib/ASRouterTargeting.jsm" line: 304}]
15:44:47 INFO - TEST-PASS | browser/components/newtab/test/browser/browser_asrouter_trigger_listeners.js | should receive page visits from existing windows -
15:44:47 INFO - TEST-PASS | browser/components/newtab/test/browser/browser_asrouter_trigger_listeners.js | should not receive page visits for different domains -
15:44:47 INFO - TEST-PASS | browser/components/newtab/test/browser/browser_asrouter_trigger_listeners.js | should not receive page visits from existing private windows -
15:44:47 INFO - Buffered messages logged at 15:44:44
15:44:47 INFO - TEST-PASS | browser/components/newtab/test/browser/browser_asrouter_trigger_listeners.js | should receive page visits from newly opened windows -
15:44:47 INFO - Buffered messages logged at 15:44:45
15:44:47 INFO - TEST-PASS | browser/components/newtab/test/browser/browser_asrouter_trigger_listeners.js | should not receive page visits from newly opened private windows -
15:44:47 INFO - TEST-PASS | browser/components/newtab/test/browser/browser_asrouter_trigger_listeners.js | should now not receive page visits from existing windows -
15:44:47 INFO - Buffered messages logged at 15:44:46
15:44:47 INFO - TEST-PASS | browser/components/newtab/test/browser/browser_asrouter_trigger_listeners.js | should now not receive page visits from newly opened windows -
15:44:47 INFO - Buffered messages finished
15:44:47 INFO - TEST-UNEXPECTED-FAIL | browser/components/newtab/test/browser/browser_asrouter_trigger_listeners.js | A promise chain failed to handle a rejection: win.ownerGlobal.gBrowser is undefined - stack: get hasPinnedTabs@resource://activity-stream/lib/ASRouterTargeting.jsm:304:11

Regressed by: 1552366

r1cky, looks like bug 1546429 is the immediate regression with the browser.ini changes:

  browser.newtabpage.activity-stream.asrouter.devtoolsEnabled=true

Although the failing code was added in bug 1528959:

  get hasPinnedTabs() {
…
      if (win.ownerGlobal.gBrowser.visibleTabs.filter(t => t.pinned).length) {

which might get fixed with a simple win.ownerGlobal.gBrowser && (pushing to try now)

k88hudson, the underlying issue seems to be that all messages get loaded from all providers with devtoolsEnabled=true making use of targeting that might not have been expected to be used in these testing conditions, e.g., browser_asrouter_trigger_listeners.js opens up a lot of windows and closes them. I wonder if ASRouter could be made more robust in some way to hide these "test condition" differences so those writing targeting like hasPinnedTabs don't need to worry about odd behaviors such as gBrowser not existing.

Flags: needinfo?(edilee) → needinfo?(khudson)
Regressed by: 1546429, 1528959

Pushed a couple try for now:

./mach try fuzzy browser/components/newtab/test/browser/browser_asrouter_trigger_listeners.js -q "'10-64-asan" --rebuild 5

https://treeherder.mozilla.org/#/jobs?repo=try&fromchange=741f8c7c174526e50b1178c66711799e43a480d7&tochange=7b61e43c2e35be6319e14eacff5be29a1aea319a

Pushed by elee@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/4a74609752d2
Check for gBrowser before checking for pinned tabs r=r1cky
Status: NEW → RESOLVED
Closed: 1 year ago
Resolution: --- → FIXED
Target Milestone: --- → Firefox 68
Iteration: --- → 69.1 - May 13 - 26
Priority: P5 → P1

Yeah, having devtoolsEnabled=true might not be the best idea in tests since it doesn't simulate the actual environment of what's being shown to users

Flags: needinfo?(khudson)

(In reply to Kate Hudson :k88hudson from comment #8)

Yeah, having devtoolsEnabled=true might not be the best idea in tests since it doesn't simulate the actual environment of what's being shown to users

Going to make that change https://bugzilla.mozilla.org/show_bug.cgi?id=1553450

Component: Activity Streams: Newtab → New Tab Page
You need to log in before you can comment on or make changes to this bug.