Last Comment Bug 786085 - Intermittent browser_notifications.js | failed to find the notification, | Found an unexpected alert:alert at the end of test run
: Intermittent browser_notifications.js | failed to find the notification, | Fo...
Status: RESOLVED FIXED
: intermittent-failure
Product: Firefox
Classification: Client Software
Component: SocialAPI (show other bugs)
: Trunk
: x86 Windows XP
: -- normal (vote)
: Firefox 18
Assigned To: Mark Hammond [:markh]
:
Mentors:
Depends on:
Blocks: 438871 774506
  Show dependency treegraph
 
Reported: 2012-08-27 15:42 PDT by Phil Ringnalda (:philor, back in August)
Modified: 2012-11-25 19:31 PST (History)
3 users (show)
See Also:
Crash Signature:
(edit)
QA Whiteboard:
Iteration: ---
Points: ---
Has Regression Range: ---
Has STR: ---
+
fixed


Attachments
Use a mock alerts service (7.67 KB, patch)
2012-08-29 01:00 PDT, Mark Hammond [:markh]
gavin.sharp: review-
Details | Diff | Splinter Review
updated based on review (6.40 KB, patch)
2012-08-29 18:45 PDT, Mark Hammond [:markh]
gavin.sharp: review+
gavin.sharp: approval‑mozilla‑aurora+
Details | Diff | Splinter Review

Description Phil Ringnalda (:philor, back in August) 2012-08-27 15:42:20 PDT
https://tbpl.mozilla.org/php/getParsedLog.php?id=14749819&tree=Mozilla-Inbound
Rev3 WINNT 5.1 mozilla-inbound debug test mochitest-other on 2012-08-27 07:39:45 PDT for push febe1ad166da
slave: talos-r3-xp-016

TEST-UNEXPECTED-FAIL | chrome://mochitests/content/browser/toolkit/components/social/test/browser/browser_notifications.js | failed to find the notification popup
Stack trace:
    JS frame :: chrome://mochitests/content/browser/toolkit/components/social/test/browser/browser_notifications.js :: <TOP_LEVEL> :: line 119
    JS frame :: chrome://mochikit/content/browser-test.js :: <TOP_LEVEL> :: line 500

TEST-INFO | chrome://mochitests/content/browser/toolkit/components/social/test/browser/browser_notifications.js | sub-test testNotificationCallback complete
WARNING: Nv3DVStreaming CoCreateInstance failed (disabled).: file e:/builds/moz2_slave/m-in-w32-dbg/build/gfx/layers/d3d9/Nv3DVUtils.cpp, line 53
INFO TEST-END | chrome://mochitests/content/browser/toolkit/components/social/test/browser/browser_notifications.js | finished in 663ms
TEST-INFO | checking window state
TEST-UNEXPECTED-FAIL | chrome://mochitests/content/browser/toolkit/components/social/test/browser/browser_notifications.js | Found an unexpected alert:alert at the end of test run

https://tbpl.mozilla.org/php/getParsedLog.php?id=14756749&tree=Mozilla-Inbound
Rev3 WINNT 5.1 mozilla-inbound opt test mochitest-other on 2012-08-27 14:42:21 PDT for push 807627473028
slave: talos-r3-xp-062

TEST-UNEXPECTED-FAIL | chrome://mochitests/content/browser/toolkit/components/social/test/browser/browser_notifications.js | failed to find the notification popup
Stack trace:
    JS frame :: chrome://mochitests/content/browser/toolkit/components/social/test/browser/browser_notifications.js :: <TOP_LEVEL> :: line 119
    JS frame :: chrome://mochikit/content/browser-test.js :: <TOP_LEVEL> :: line 500

TEST-INFO | chrome://mochitests/content/browser/toolkit/components/social/test/browser/browser_notifications.js | sub-test testNotificationCallback complete
INFO TEST-END | chrome://mochitests/content/browser/toolkit/components/social/test/browser/browser_notifications.js | finished in 73ms
TEST-INFO | checking window state
TEST-UNEXPECTED-FAIL | chrome://mochitests/content/browser/toolkit/components/social/test/browser/browser_notifications.js | Found an unexpected unknown window at the end of test run
Comment 1 Treeherder Robot 2012-08-27 17:20:26 PDT
RyanVM
https://tbpl.mozilla.org/php/getParsedLog.php?id=14759037&tree=Mozilla-Inbound
Rev3 WINNT 5.1 mozilla-inbound pgo test mochitest-other on 2012-08-27 16:35:05
slave: talos-r3-xp-007

TEST-UNEXPECTED-FAIL | chrome://mochitests/content/browser/toolkit/components/social/test/browser/browser_notifications.js | failed to find the notification popup
Comment 2 Treeherder Robot 2012-08-27 23:38:21 PDT
philor
https://tbpl.mozilla.org/php/getParsedLog.php?id=14767358&tree=Mozilla-Aurora
Rev3 WINNT 5.1 mozilla-aurora pgo test mochitest-other on 2012-08-27 22:52:45
slave: talos-r3-xp-034

TEST-UNEXPECTED-FAIL | chrome://mochitests/content/browser/toolkit/components/social/test/browser/browser_notifications.js | failed to find the notification popup
TEST-UNEXPECTED-FAIL | chrome://mochitests/content/browser/toolkit/components/social/test/browser/browser_notifications.js | Found an unexpected unknown window at the end of test run
Comment 3 Treeherder Robot 2012-08-28 10:10:25 PDT
terrence
https://tbpl.mozilla.org/php/getParsedLog.php?id=14770180&tree=Try
Rev3 WINNT 5.1 try opt test mochitest-other on 2012-08-28 02:19:17
slave: talos-r3-xp-038

TEST-UNEXPECTED-FAIL | chrome://mochitests/content/browser/toolkit/components/social/test/browser/browser_notifications.js | failed to find the notification popup
TEST-UNEXPECTED-FAIL | chrome://mochitests/content/browser/toolkit/components/social/test/browser/browser_notifications.js | Found an unexpected unknown window at the end of test run
Comment 4 Treeherder Robot 2012-08-28 11:19:32 PDT
edmorley
https://tbpl.mozilla.org/php/getParsedLog.php?id=14780344&tree=Firefox
Rev3 WINNT 5.1 mozilla-central opt test mochitest-other on 2012-08-28 10:27:49
slave: talos-r3-xp-032

TEST-UNEXPECTED-FAIL | chrome://mochitests/content/browser/toolkit/components/social/test/browser/browser_notifications.js | failed to find the notification popup
Comment 5 Treeherder Robot 2012-08-28 13:03:28 PDT
RyanVM
https://tbpl.mozilla.org/php/getParsedLog.php?id=14782760&tree=Mozilla-Inbound
Rev3 WINNT 5.1 mozilla-inbound opt test mochitest-other on 2012-08-28 12:05:02
slave: talos-r3-xp-056

TEST-UNEXPECTED-FAIL | chrome://mochitests/content/browser/toolkit/components/social/test/browser/browser_notifications.js | failed to find the notification popup
Comment 6 :Gavin Sharp [email: gavin@gavinsharp.com] 2012-08-28 13:28:08 PDT
findPopup() is not robust - it uses polling with a hardcoded limit of 50 attempts to find the right popup (if the chrome document doesn't load quickly enough, it will fail).

A more robust test would be to use the mock alerts service implementation in notification_common.js to avoid testing the actual alerts implementation, and focus on testing the Social-related aspects of the functionality.
Comment 7 Treeherder Robot 2012-08-28 16:41:15 PDT
RyanVM
https://tbpl.mozilla.org/php/getParsedLog.php?id=14788023&tree=Firefox
Rev3 WINNT 5.1 mozilla-central pgo test mochitest-other on 2012-08-28 15:36:31
slave: talos-r3-xp-055

TEST-UNEXPECTED-FAIL | chrome://mochitests/content/browser/toolkit/components/social/test/browser/browser_notifications.js | failed to find the notification popup
TEST-UNEXPECTED-FAIL | chrome://mochitests/content/browser/toolkit/components/social/test/browser/browser_notifications.js | Found an unexpected unknown window at the end of test run
TEST-UNEXPECTED-FAIL | chrome://mochitests/content/browser/toolkit/mozapps/extensions/test/browser/browser_bug562797.js | Should be showing the webpage - Got about:addons, expected http://example.com/
TEST-UNEXPECTED-FAIL | chrome://mochitests/content/browser/toolkit/mozapps/extensions/test/browser/browser_bug562797.js | Should not be able to go back
TEST-UNEXPECTED-FAIL | chrome://mochitests/content/browser/toolkit/mozapps/extensions/test/browser/browser_bug562797.js | Should be able to go forward
TEST-UNEXPECTED-FAIL | chrome://mochitests/content/browser/toolkit/mozapps/extensions/test/browser/browser_bug562797.js | Test timed out
TEST-UNEXPECTED-FAIL | chrome://mochitests/content/browser/toolkit/mozapps/extensions/test/browser/browser_bug562797.js | Found a tab after previous test timed out: about:addons
Comment 8 Treeherder Robot 2012-08-28 20:16:34 PDT
philor
https://tbpl.mozilla.org/php/getParsedLog.php?id=14788195&tree=Services-Central
Rev3 WINNT 5.1 services-central opt test mochitest-other on 2012-08-28 15:35:24
slave: talos-r3-xp-022

TEST-UNEXPECTED-FAIL | chrome://mochitests/content/browser/toolkit/components/social/test/browser/browser_notifications.js | failed to find the notification popup
TEST-UNEXPECTED-FAIL | chrome://mochitests/content/browser/toolkit/components/social/test/browser/browser_notifications.js | Found an unexpected alert:alert at the end of test run
Comment 9 Treeherder Robot 2012-08-28 23:32:49 PDT
philor
https://tbpl.mozilla.org/php/getParsedLog.php?id=14797546&tree=Mozilla-Inbound
Rev3 WINNT 5.1 mozilla-inbound opt test mochitest-other on 2012-08-28 22:40:27
slave: talos-r3-xp-042

TEST-UNEXPECTED-FAIL | chrome://mochitests/content/browser/toolkit/components/social/test/browser/browser_notifications.js | failed to find the notification popup
Comment 10 Treeherder Robot 2012-08-28 23:44:14 PDT
philor
https://tbpl.mozilla.org/php/getParsedLog.php?id=14797837&tree=Mozilla-Inbound
Rev3 WINNT 5.1 mozilla-inbound opt test mochitest-other on 2012-08-28 22:52:00
slave: talos-r3-xp-037

TEST-UNEXPECTED-FAIL | chrome://mochitests/content/browser/toolkit/components/social/test/browser/browser_notifications.js | failed to find the notification popup
TEST-UNEXPECTED-FAIL | chrome://mochitests/content/browser/toolkit/components/social/test/browser/browser_notifications.js | Found an unexpected alert:alert at the end of test run
Comment 11 Mark Hammond [:markh] 2012-08-29 01:00:18 PDT
Created attachment 656360 [details] [diff] [review]
Use a mock alerts service

It seems quite hard to reuse the existing mock for a number of reasons, so I just duplicated what we need.

try run at https://tbpl.mozilla.org/?tree=Try&rev=ff83089b97cd
Comment 12 Treeherder Robot 2012-08-29 07:01:51 PDT
khuey
https://tbpl.mozilla.org/php/getParsedLog.php?id=14804906&tree=Try
Rev3 WINNT 5.1 try opt test mochitest-other on 2012-08-29 04:35:15
slave: talos-r3-xp-035

TEST-UNEXPECTED-FAIL | chrome://mochitests/content/browser/toolkit/components/social/test/browser/browser_notifications.js | failed to find the notification popup
TEST-UNEXPECTED-FAIL | chrome://mochitests/content/browser/toolkit/components/social/test/browser/browser_notifications.js | Found an unexpected unknown window at the end of test run
Comment 13 Treeherder Robot 2012-08-29 11:33:09 PDT
philor
https://tbpl.mozilla.org/php/getParsedLog.php?id=14813843&tree=Mozilla-Inbound
Rev3 WINNT 5.1 mozilla-inbound opt test mochitest-other on 2012-08-29 10:48:06
slave: talos-r3-xp-089

TEST-UNEXPECTED-FAIL | chrome://mochitests/content/browser/toolkit/components/social/test/browser/browser_notifications.js | failed to find the notification popup
TEST-UNEXPECTED-FAIL | chrome://mochitests/content/browser/toolkit/components/social/test/browser/browser_notifications.js | Found an unexpected unknown window at the end of test run
Comment 14 Treeherder Robot 2012-08-29 12:28:00 PDT
philor
https://tbpl.mozilla.org/php/getParsedLog.php?id=14814581&tree=Mozilla-Inbound
Rev3 WINNT 5.1 mozilla-inbound opt test mochitest-other on 2012-08-29 11:25:38
slave: talos-r3-xp-062

TEST-UNEXPECTED-FAIL | chrome://mochitests/content/browser/browser/devtools/debugger/test/browser_dbg_location-changes-new.js | There should be a selected script. - Didn't expect null, but got it
TEST-UNEXPECTED-FAIL | chrome://mochitests/content/browser/browser/devtools/debugger/test/browser_dbg_location-changes-new.js | The source editor should have some text displayed. - Didn't expect 0, but got it
TEST-UNEXPECTED-FAIL | chrome://mochitests/content/browser/browser/devtools/debugger/test/browser_dbg_location-changes-new.js | The menulist should not display a notice that there are no scripts availalble. - Didn't expect No scripts, but got it
TEST-UNEXPECTED-FAIL | chrome://mochitests/content/browser/browser/devtools/debugger/test/browser_dbg_location-changes-new.js | The menulist should have a tooltip text attributed. - Didn't expect , but got it
TEST-UNEXPECTED-FAIL | chrome://mochitests/content/browser/toolkit/components/social/test/browser/browser_notifications.js | failed to find the notification popup
Comment 15 Treeherder Robot 2012-08-29 14:44:21 PDT
philor
https://tbpl.mozilla.org/php/getParsedLog.php?id=14817801&tree=Mozilla-Inbound
Rev3 WINNT 5.1 mozilla-inbound opt test mochitest-other on 2012-08-29 13:55:32
slave: talos-r3-xp-047

TEST-UNEXPECTED-FAIL | chrome://mochitests/content/browser/toolkit/components/social/test/browser/browser_notifications.js | failed to find the notification popup
Comment 16 :Gavin Sharp [email: gavin@gavinsharp.com] 2012-08-29 17:53:01 PDT
Comment on attachment 656360 [details] [diff] [review]
Use a mock alerts service

>diff --git a/toolkit/components/social/test/browser/browser_notifications.js b/toolkit/components/social/test/browser/browser_notifications.js

>+function force_prompt(allow) {

I know you just copied this stuff, but I don't really understand the name of the function, or why it sets the "notification.prompt" prefs - those seem to be specific to "desktop notifications" which aren't relevant here. You also don't need the enablePrivilege calls. I'd make this just:

function replaceAlertsService() {
>+  Components.manager.QueryInterface(Components.interfaces.nsIComponentRegistrar)
>+            .registerFactory(FAKE_CID, "",
>+                             ALERTS_SERVICE_CONTRACT_ID,
>+                             factory)
>+}

function restoreAlertsService()
>+  Components.manager.QueryInterface(Components.interfaces.nsIComponentRegistrar)
>+            .registerFactory(ALERTS_SERVICE_CID, "",
>+                             ALERTS_SERVICE_CONTRACT_ID,
>+                             null);
>+}

>+function force_click_on_notification(val) {
>+function is_feature_enabled() {

These are unused so you shouldn't copy them.

> function test() {
>   waitForExplicitFinish();
> 
>+  let cbPreTest = function(cb) {
>+    force_prompt(true);
>+    cb();
>+  };
>   let cbPostTest = function(cb) {
>+    reset_prompt();
>     SocialService.removeProvider(TEST_PROVIDER_ORIGIN, function() {cb()});
>   };
>+  runTests(tests, cbPreTest, cbPostTest);

IIRC this pretest and posttest are run before/after every individual test - it would be sufficient to just call replaceAlertsService once here before runTests(), and then registerCleanupFunction(restoreAlertsService).

Looks good otherwise; I assume you've tested that the test still fails/passes appropriately with these changes.
Comment 17 Mark Hammond [:markh] 2012-08-29 18:45:58 PDT
Created attachment 656704 [details] [diff] [review]
updated based on review

Changes as requested.

> Looks good otherwise; I assume you've tested that the test still 
> fails/passes appropriately with these changes.

Not sure what you mean here - the test still passes and eyeballing the test output shows all the test checks are actually made.  I posted a URL to the try run of the old patch and a new try run with this patch is at https://tbpl.mozilla.org/?tree=Try&rev=db8d019276b0
Comment 18 Treeherder Robot 2012-08-29 18:50:07 PDT
RyanVM
https://tbpl.mozilla.org/php/getParsedLog.php?id=14822777&tree=Try
Rev3 WINNT 5.1 try opt test mochitest-other on 2012-08-29 17:53:56
slave: talos-r3-xp-044

13579 ERROR TEST-UNEXPECTED-FAIL | chrome://mochitests/content/chrome/toolkit/components/osfile/tests/mochi/test_osfile_front.xul | test_iter_dir: nextBatch on closed iterator returns an empty array - got 45, expected 0
TEST-UNEXPECTED-FAIL | chrome://mochitests/content/browser/toolkit/components/social/test/browser/browser_notifications.js | failed to find the notification popup
TEST-UNEXPECTED-FAIL | chrome://mochitests/content/browser/toolkit/components/social/test/browser/browser_notifications.js | Found an unexpected alert:alert at the end of test run
Comment 19 :Gavin Sharp [email: gavin@gavinsharp.com] 2012-08-29 18:52:12 PDT
I mean that it's worth checking that if you break the notification functionality being tested intentionally, the test reports a failure and does so in a reasonably illustrative way. Always worth testing that in addition to testing that the test still passes when making test changes.
Comment 21 Mark Hammond [:markh] 2012-08-29 23:54:02 PDT
Comment on attachment 656704 [details] [diff] [review]
updated based on review

[Approval Request Comment]
This is a test-only fix for an intermittent orange.
Bug caused by (feature/regressing bug #): 774506
User impact if declined: moar orange.
Testing completed (on m-c, etc.): landed on inbound.
Risk to taking this patch (and alternatives if risky): None
String or UUID changes made by this patch: None
Comment 22 Treeherder Robot 2012-08-30 01:12:42 PDT
edmorley
https://tbpl.mozilla.org/php/getParsedLog.php?id=14829752&tree=Profiling
Rev3 WINNT 5.1 profiling opt test mochitest-other on 2012-08-30 00:18:25
slave: talos-r3-xp-029

TEST-UNEXPECTED-FAIL | chrome://mochitests/content/browser/toolkit/components/social/test/browser/browser_notifications.js | failed to find the notification popup
Comment 23 Treeherder Robot 2012-08-30 03:35:52 PDT
edmorley
https://tbpl.mozilla.org/php/getParsedLog.php?id=14829977&tree=Ionmonkey
Rev3 WINNT 5.1 ionmonkey opt test mochitest-other on 2012-08-30 00:22:58
slave: talos-r3-xp-068

TEST-UNEXPECTED-FAIL | chrome://mochitests/content/browser/toolkit/components/social/test/browser/browser_notifications.js | failed to find the notification popup
TEST-UNEXPECTED-FAIL | chrome://mochitests/content/browser/toolkit/components/social/test/browser/browser_notifications.js | Found an unexpected unknown window at the end of test run
Comment 24 Ed Morley [:emorley] 2012-08-30 03:49:46 PDT
https://hg.mozilla.org/mozilla-central/rev/1b0b56afa33a
Comment 25 Treeherder Robot 2012-08-30 16:02:49 PDT
philor
https://tbpl.mozilla.org/php/getParsedLog.php?id=14852842&tree=Ionmonkey
Rev3 WINNT 5.1 ionmonkey pgo test mochitest-other on 2012-08-30 15:13:07
slave: talos-r3-xp-037

TEST-UNEXPECTED-FAIL | chrome://mochitests/content/browser/toolkit/components/social/test/browser/browser_notifications.js | failed to find the notification popup
Comment 26 Ryan VanderMeulen [:RyanVM] 2012-08-30 18:02:58 PDT
https://hg.mozilla.org/releases/mozilla-aurora/rev/0b5de274b868
Comment 27 Treeherder Robot 2012-09-03 10:43:43 PDT
ryanvm%gmail.com
https://tbpl.mozilla.org/php/getParsedLog.php?id=14925980&tree=Try
Rev3 WINNT 5.1 try opt test mochitest-other on 2012-09-03 09:57:34
slave: talos-r3-xp-036

TEST-UNEXPECTED-FAIL | chrome://mochitests/content/browser/browser/components/sessionstore/test/browser_461743.js | Test timed out
TEST-UNEXPECTED-FAIL | chrome://mochitests/content/browser/browser/components/sessionstore/test/browser_461743.js | Found a tab after previous test timed out: http://mochi.test:8888/browser/browser/components/sessionstore/test/browser_461743_sample.html
TEST-UNEXPECTED-FAIL | chrome://mochitests/content/browser/browser/components/sessionstore/test/browser_461743.js | Found a tab after previous test timed out: http://mochi.test:8888/browser/browser/components/sessionstore/test/browser_461743_sample.html
TEST-UNEXPECTED-FAIL | chrome://mochitests/content/browser/toolkit/components/social/test/browser/browser_notifications.js | failed to find the notification popup
TEST-UNEXPECTED-FAIL | chrome://mochitests/content/browser/toolkit/components/social/test/browser/browser_notifications.js | Found an unexpected unknown window at the end of test run
Comment 28 Treeherder Robot 2012-09-03 10:44:10 PDT
ryanvm%gmail.com
https://tbpl.mozilla.org/php/getParsedLog.php?id=14925986&tree=Try
Rev3 WINNT 5.1 try opt test mochitest-other on 2012-09-03 09:58:36
slave: talos-r3-xp-071

TEST-UNEXPECTED-FAIL | chrome://mochitests/content/browser/toolkit/components/social/test/browser/browser_notifications.js | failed to find the notification popup
TEST-UNEXPECTED-FAIL | chrome://mochitests/content/browser/toolkit/components/social/test/browser/browser_notifications.js | Found an unexpected alert:alert at the end of test run
Comment 29 Treeherder Robot 2012-09-03 11:22:32 PDT
ryanvm%gmail.com
https://tbpl.mozilla.org/php/getParsedLog.php?id=14926496&tree=Try
Rev3 WINNT 5.1 try opt test mochitest-other on 2012-09-03 10:40:18
slave: talos-r3-xp-040

TEST-UNEXPECTED-FAIL | chrome://mochitests/content/browser/toolkit/components/social/test/browser/browser_notifications.js | failed to find the notification popup
Comment 30 Treeherder Robot 2012-09-03 12:26:48 PDT
ryanvm%gmail.com
https://tbpl.mozilla.org/php/getParsedLog.php?id=14926903&tree=Try
Rev3 WINNT 5.1 try opt test mochitest-other on 2012-09-03 11:43:06
slave: talos-r3-xp-055

TEST-UNEXPECTED-FAIL | chrome://mochitests/content/browser/toolkit/components/social/test/browser/browser_notifications.js | failed to find the notification popup
TEST-UNEXPECTED-FAIL | chrome://mochitests/content/browser/toolkit/components/social/test/browser/browser_notifications.js | Found an unexpected unknown window at the end of test run
Comment 31 Treeherder Robot 2012-09-03 12:27:03 PDT
ryanvm%gmail.com
https://tbpl.mozilla.org/php/getParsedLog.php?id=14926898&tree=Try
Rev3 WINNT 5.1 try opt test mochitest-other on 2012-09-03 11:44:17
slave: talos-r3-xp-007

TEST-UNEXPECTED-FAIL | chrome://mochitests/content/browser/toolkit/components/social/test/browser/browser_notifications.js | failed to find the notification popup
Comment 32 Treeherder Robot 2012-09-03 12:32:13 PDT
ryanvm%gmail.com
https://tbpl.mozilla.org/php/getParsedLog.php?id=14926918&tree=Try
Rev3 WINNT 5.1 try opt test mochitest-other on 2012-09-03 11:44:04
slave: talos-r3-xp-039

TEST-UNEXPECTED-FAIL | chrome://mochitests/content/browser/toolkit/components/social/test/browser/browser_notifications.js | failed to find the notification popup
TEST-UNEXPECTED-FAIL | chrome://mochitests/content/browser/toolkit/components/social/test/browser/browser_notifications.js | Found an unexpected alert:alert at the end of test run

Note You need to log in before you can comment on or make changes to this bug.