Fix ui-sidebar tests to catch uncaught promise rejections



Add-on SDK
3 years ago
3 years ago


(Reporter: jsantell, Assigned: erikvold)


Firefox Tracking Flags

(Not tracked)



(1 attachment)

Once bug 1052633 lands, we'll be able to test for uncaught rejections in promises during tests. To enable these while debugging, uncomment-out the `fail` line in `sdk/deprecated/unit-test.js` inside the `_uncaughtErrorObserver` handler.

With this enabled, the only tests failing are ui-sidebar tests:
 addon-sdk/tests/test-ui-sidebar.testChangingURLBackToOriginalValue: failure
  addon-sdk/tests/test-ui-sidebar.testClickingACheckedMenuitem: failure
  addon-sdk/tests/test-ui-sidebar.testDestroyEdgeCaseBug: failure
  addon-sdk/tests/test-ui-sidebar.testDetachEventOnWindowClose: failure
  addon-sdk/tests/test-ui-sidebar.testDuplicateID: failure
  addon-sdk/tests/test-ui-sidebar.testEventListeners: failure
  addon-sdk/tests/test-ui-sidebar.testGCdHiddenSidebarsOnUnload: failure
  addon-sdk/tests/test-ui-sidebar.testHideEventOnWindowClose: failure
  addon-sdk/tests/test-ui-sidebar.testHidingAHiddenSidebarRejects: failure
  addon-sdk/tests/test-ui-sidebar.testShowHideRawWindowArg: failure
  addon-sdk/tests/test-ui-sidebar.testShowHideSDKWindowArg: failure
  addon-sdk/tests/test-ui-sidebar.testShowToOpenMenuitemToClose: failure
  addon-sdk/tests/test-ui-sidebar.testShowingInOneWindowDoesNotAffectOtherWindows: failure
  addon-sdk/tests/test-ui-sidebar.testShowingOneSidebarAfterAnother: failure
  addon-sdk/tests/test-ui-sidebar.testSideBarIsInNewWindows: failure
  addon-sdk/tests/test-ui-sidebar.testSidebarBasicLifeCycle: failure
  addon-sdk/tests/test-ui-sidebar.testSidebarGettersAndSettersAfterDestroy: failure
  addon-sdk/tests/test-ui-sidebar.testSidebarLeakCheckUnloadAfterAttach: failure
  addon-sdk/tests/test-ui-sidebar.testTwoSidebarsWithSameTitleAndURL: failure
  addon-sdk/tests/test-ui-sidebar.testURLSetter: failure
  addon-sdk/tests/test-ui-sidebar.testURLSetterToSameValueReloadsSidebar: failure
  addon-sdk/tests/test-ui-sidebar.testUndefinedID: failure
  addon-sdk/tests/test-ui-sidebar-private-browsing.testShowInPrivateWindow: failure
  addon-sdk/tests/test-ui-sidebar-private-browsing.testSideBarIsNotInNewPrivateWindows: failure

Matteo, pinging you on this as you're most familiar with sidebar.


3 years ago
Flags: needinfo?(zer0)


3 years ago
Blocks: 998277
ni?ing you erik, Matteo said you'd be more familiar with these
Flags: needinfo?(zer0) → needinfo?(evold)
Assignee: nobody → evold
Flags: needinfo?(evold)
Created attachment 8471843 [details] [review]
Link to Github pull-request:
Attachment #8471843 - Flags: review?(jsantell)
Comment on attachment 8471843 [details] [review]
Link to Github pull-request:

Attachment #8471843 - Flags: review?(jsantell) → review+

Comment 4

3 years ago
Commits pushed to master at
Bug 1052667 - Fix ui-sidebar tests to catch uncaught promise rejections
Merge pull request #1581 from erikvold/1052667

Bug 1052667 - Fix ui-sidebar tests to catch uncaught promise rejections, r=@jsantell


3 years ago
Last Resolved: 3 years ago
Resolution: --- → FIXED
Should this fix be cherry-picked into 1.17? Currently I see failures like this from running the tests in 1.17 with Firefox 31.
Flags: needinfo?(jsantell)
This was just merged 2 days ago, so failures for this won't be in 1.17 or FF31 -- are they just warning messages? Could help, but not sure how important it is (and most uncaught rejections were silent, I'm surprised these were shown before bug 998277
Flags: needinfo?(jsantell)
When I was testing yesterday, I did:

* check out firefox31 or sdk 1.17 branches
* run ./bin/cfx -b /Applications/ testall

I got a bunch of errors like this:

Date: Thu Aug 14 2014 15:55:34 GMT-0700 (PDT)
Full Message: Error: The sidebar is already hidden" {file: "resource://gre/modules/addons/XPIProvider.jsm ->
-> resource://extensions.modules.56ce2c9c-d8b7-4c17-965c-5b838dabc285-at-jetpack.commonjs.path/toolkit/loader.js
-> resource://extensions.modules.56ce2c9c-d8b7-4c17-965c-5b838dabc285-at-jetpack.commonjs.path/sdk/ui/sidebar/view.js"
line: 171 column: 0 source: "171"}]
Checking out firefox31 branch, with Fx31 as my binary, I too see these errors, but this isn't from promises now throwing on rejection in tests (that isn't in the firefox31 branch), and I see other errors in there as well. Is this an issue of tests failing on non-nightly? Should probably track it in a different bug if we should fix that
You need to log in before you can comment on or make changes to this bug.