Closed Bug 882575 Opened 11 years ago Closed 11 years ago

Intermittent browser_capabilities.js,browser_707862.js | uncaught exception - TypeError: snippets is undefined at about:home:89

Categories

(Firefox :: Session Restore, defect)

defect
Not set
normal

Tracking

()

RESOLVED FIXED
Firefox 25
Tracking Status
firefox24 --- fixed
firefox25 --- fixed

People

(Reporter: philor, Assigned: philor)

References

Details

(Keywords: intermittent-failure)

Isn't about:home an unsafe URL to use in tests, because it depends on being able to contact snippets.m.c? Certainly seems to be, since it started failing partway through the runs on one push.

https://tbpl.mozilla.org/php/getParsedLog.php?id=24094524&tree=Mozilla-Inbound
https://tbpl.mozilla.org/php/getParsedLog.php?id=24094062&tree=Mozilla-Inbound
https://tbpl.mozilla.org/php/getParsedLog.php?id=24094933&tree=Mozilla-Inbound
https://tbpl.mozilla.org/php/getParsedLog.php?id=24094348&tree=Mozilla-Inbound
https://tbpl.mozilla.org/php/getParsedLog.php?id=24094777&tree=Mozilla-Inbound
https://tbpl.mozilla.org/php/getParsedLog.php?id=24094668&tree=Mozilla-Inbound
https://tbpl.mozilla.org/php/getParsedLog.php?id=24094538&tree=Mozilla-Inbound

23:26:12  WARNING -  TEST-UNEXPECTED-FAIL | chrome://mochitests/content/browser/browser/components/sessionstore/test/browser_capabilities.js | uncaught exception - TypeError: snippets is undefined at about:home:89
23:26:12     INFO -  Stack trace:
23:26:12     INFO -      JS frame :: chrome://mochikit/content/tests/SimpleTest/SimpleTest.js :: simpletestOnerror :: line 1136
23:26:12     INFO -      native frame :: <unknown filename> :: <TOP_LEVEL> :: line 0
23:26:12     INFO -  TEST-INFO | chrome://mochitests/content/browser/browser/components/sessionstore/test/browser_capabilities.js | Console message: [JavaScript Error: "TypeError: snippets is undefined" {file: "about:home" line: 89}]
(In reply to Phil Ringnalda (:philor) from comment #0)
> Isn't about:home an unsafe URL to use in tests, because it depends on being
> able to contact snippets.m.c? Certainly seems to be, since it started
> failing partway through the runs on one push.

Joel, seems like another URL we need to stub out in the test harness... 
http://mxr.mozilla.org/mozilla-central/source/browser/app/profile/firefox.js#253
Blocks: 617414
(In reply to Phil Ringnalda (:philor) from comment #0)
> Isn't about:home an unsafe URL to use in tests, because it depends on being
> able to contact snippets.m.c? Certainly seems to be, since it started
> failing partway through the runs on one push.

the code can handle being unable to contact the snippets service.

Instead this looks like it was able to load the remote snippets, but those contained this type error.
Flags: needinfo?(mkelly)
btw yes, you should block loading from the snippets server in the harness.
Depends on: 882610
No longer blocks: 617414
Test started using about:home as of bug 863227.

I've disabled the test on all platforms, since it's causing orange all over the place:
https://hg.mozilla.org/mozilla-central/rev/b197bed90a98
(Note: contrary to my commit message, about:home is serving broken content rather than being down; I missed comment 65 before committing).

Can be re-enabled once bug 882610 is fixed or this test uses something other than about:home.
Blocks: 863227
(In reply to Marco Bonardo [:mak] from comment #65)
> Instead this looks like it was able to load the remote snippets, but those
> contained this type error.

We're not getting any reports about about:home being borked and the impression data for snippets suggests that users are still seeing snippets, so at first glance it doesn't look to me like the extra snippet JS is generally broken, but it could be failing in this specific case.

Bug 882610 seems like the right fix here, but let me know if you want me to chase down the error. :)
Flags: needinfo?(mkelly)
(In reply to Michael Kelly [:mkelly] from comment #178)
> Bug 882610 seems like the right fix here, but let me know if you want me to
> chase down the error. :)

My impression is that there is a snippets var used without a null-check in the remote snippets, thus the type error. Though I based my impression on the fact the only point we have a snippets var is null-checked in abouthome.js and the error is pointing to code we don't have locally.
(In reply to Marco Bonardo [:mak] from comment #179)
> My impression is that there is a snippets var used without a null-check in
> the remote snippets, thus the type error. Though I based my impression on
> the fact the only point we have a snippets var is null-checked in
> abouthome.js and the error is pointing to code we don't have locally.

The remote code can be seen at https://github.com/mozilla/snippets/blob/master/standard-js/snippet.html#L26. The only snippets variable it uses is the result of a call to getElementsByClassname, which should never return null AFAIK. When no elements are found it should return an empty HTMLCollection, right?

...unless part of this test mocks out that method and makes it return undefined?
https://tbpl.mozilla.org/php/getParsedLog.php?id=24107079&tree=Mozilla-Inbound
Summary: Intermittent browser_capabilities.js | uncaught exception - TypeError: snippets is undefined at about:home:89 → Intermittent browser_capabilities.js,browser_707862.js | uncaught exception - TypeError: snippets is undefined at about:home:89
Whiteboard: [test disabled][leave open]
Bug 888031 removed about:home from both browser_capabilities.js and browser_707862.js.
Depends on: 888031
Reenabled in http://hg.mozilla.org/integration/mozilla-inbound/rev/01f90ae5c64c
Whiteboard: [test disabled][leave open]
https://hg.mozilla.org/mozilla-central/rev/01f90ae5c64c
Assignee: nobody → philringnalda
Status: NEW → RESOLVED
Closed: 11 years ago
Resolution: --- → FIXED
Target Milestone: --- → Firefox 25
You need to log in before you can comment on or make changes to this bug.