Loop mocha tests with DOM Promises have failure modes that are hard to understand/debug

RESOLVED FIXED in mozilla36

Status

Hello (Loop)
Client
RESOLVED FIXED
4 years ago
4 years ago

People

(Reporter: dmose, Assigned: dmose)

Tracking

unspecified
mozilla36
x86
Mac OS X
Points:
---

Firefox Tracking Flags

(Not tracked)

Details

Attachments

(1 attachment)

(Assignee)

Description

4 years ago
Rather than showing how the test failed, they just time out, and it's hard to figure out why.  Tbpl/Treeherder logs would be fairly useless in the case of failures here.

The fix is to upgrade Mocha to version 2.0.1.  The important change is that newer versions of Mocha support promises natively: you no longer use function(done) to declare the test as async.  Instead, you just have the test return the last promise on the chain.
(Assignee)

Comment 1

4 years ago
Created attachment 8517058 [details] [diff] [review]
[landed fx-team] Update Loop mocha unit test framework to v2.0.1, which supports Promises
(Assignee)

Comment 2

4 years ago
Comment on attachment 8517058 [details] [diff] [review]
[landed fx-team] Update Loop mocha unit test framework to v2.0.1, which supports Promises

I've just fixed up the Promise uses that we introduced in multiplexGum_test.js.  It's not clear from a quick skim that the other existing promise uses in the tree would benefit as much from being tweaked to the new API, though it's certainly possible that they will.

This release of Mocha includes a wide variety of fixes and a few enhancements, everything, back to and include 1.18 in the History file:

https://github.com/mochajs/mocha/blob/2.0.1/History.md
Attachment #8517058 - Flags: review?(standard8)
(Assignee)

Comment 3

4 years ago
Note that the reason there is no mocha.css diff included in the patch is because that file is literally unchanged since 1.17.1.
Attachment #8517058 - Flags: review?(standard8) → review+
(Assignee)

Updated

4 years ago
Attachment #8517058 - Attachment description: Update Loop mocha unit test framework to v2.0.1, which supports Promises → [landed fx-team] Update Loop mocha unit test framework to v2.0.1, which supports Promises
https://hg.mozilla.org/mozilla-central/rev/1b52d3719b7f
Status: NEW → RESOLVED
Last Resolved: 4 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla36

Updated

4 years ago
Iteration: --- → 36.3
You need to log in before you can comment on or make changes to this bug.