Closed Bug 998277 Opened 9 years ago Closed 9 years ago

Uncaught async Promise errors should cause sdk tests to fail


(Add-on SDK Graveyard :: General, defect, P2)



(Not tracked)



(Reporter: Yoric, Assigned: jsantell)


(Blocks 1 open bug)



(1 file)

      No description provided.
Yoric, can you give example tests where this is actually a concern? most (if not all) async tests already have something like


which to my understanding already fails in the case of async promise error, though not explicitly, but because of a test timeout.
Well, that's assuming that you have added a terminator to all promises.
With xpcshell tests and mochitests we found out that we are missing a number of errors simply because ensuring that we have caught all async errors is hard/impossible. Promise.jsm provides a way to detect most of these errors, but if the test suite doesn't take this into account, that's not very useful.
so, we are usually careful about stuff like that, but i understand this is more of a "defense in depth" thing..

then i guess it depends on bug 881047.
Depends on: 881047
Test with the patch in bug 1016387
Assignee: nobody → jsantell
Patch in bug 1016387 does not work for SDK tests, we'll have to hook into Promise.jsm's `Debugger.addUncaughtErrorObserver` into the SDK test harness.
Depends on: 1052633
Depends on: 1052667
Attached file GH PR 1582
Attachment #8471857 - Flags: review?(evold)
Attachment #8471857 - Flags: review?(evold) → review+
Commits pushed to master at
Bug 998277 - Enable tests breaking on uncaught promise rejections
Merge pull request #1582 from jsantell/998277

Bug 998277 - Enable tests breaking on uncaught promise rejections, r=@erikvold
Closed: 9 years ago
Resolution: --- → FIXED
Depends on: 1053809
Depends on: 1054399
Depends on: 1054401
Depends on: 1054402
No longer depends on: 1054399
Depends on: 1054404
Depends on: 1054405
Depends on: 1054406
Depends on: 1054407
You need to log in before you can comment on or make changes to this bug.