Fix ui-sidebar tests to catch uncaught promise rejections

RESOLVED FIXED

Status

Add-on SDK
General
RESOLVED FIXED
3 years ago
3 years ago

People

(Reporter: jsantell, Assigned: erikvold)

Tracking

Firefox Tracking Flags

(Not tracked)

Details

Attachments

(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.
(Reporter)

Updated

3 years ago
Flags: needinfo?(zer0)
(Reporter)

Updated

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: https://github.com/mozilla/addon-sdk/pull/1581
Attachment #8471843 - Flags: review?(jsantell)
Comment on attachment 8471843 [details] [review]
Link to Github pull-request: https://github.com/mozilla/addon-sdk/pull/1581

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

Comment 4

3 years ago
Commits pushed to master at https://github.com/mozilla/addon-sdk

https://github.com/mozilla/addon-sdk/commit/938ca866eb56ef8a2683105dee530145fa8e3a43
Bug 1052667 - Fix ui-sidebar tests to catch uncaught promise rejections

https://github.com/mozilla/addon-sdk/commit/340def8f5c5efd9fc235d56d72638e2a630c839e
Merge pull request #1581 from erikvold/1052667

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

Updated

3 years ago
Status: NEW → RESOLVED
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/Firefox.app testall

I got a bunch of errors like this:

https://gist.github.com/canuckistani/ae6ced5ef767f13ddc4a

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 ->
jar:file:///var/folders/xw/dlflj93n4z33pxpd0k_hlss80000gq/T/tmp_jaaUM.mozrunner/extensions/56ce2c9c-d8b7-4c17-965c-5b838dabc285@jetpack.xpi!/bootstrap.js
-> 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
Sure.
You need to log in before you can comment on or make changes to this bug.