Closed
Bug 1207702
Opened 9 years ago
Closed 9 years ago
Fix a bug in test_promises_object_timetosettle-02.js.
Categories
(DevTools :: Debugger, defect)
DevTools
Debugger
Tracking
(firefox45 fixed)
RESOLVED
FIXED
Firefox 45
Tracking | Status | |
---|---|---|
firefox45 | --- | fixed |
People
(Reporter: ejpbruel, Assigned: ejpbruel)
References
(Blocks 1 open bug)
Details
Attachments
(1 file, 1 obsolete file)
2.20 KB,
patch
|
fitzgen
:
review+
|
Details | Diff | Splinter Review |
While refactoring the script actors to use protocol.js in bug 1037992, this test started failing for me. After some investigation, there seem to be a couple of things wrong with this test: - The test sends an attach request to a promise front. The attach handler of the promise actor eventually calls createSourceActors on TabSources. TabSources needs this._thread to be set to the ThreadActor in order to work properly. This field won't be set until we attach to a Chrome or TabActor. Nowhere in the test do we actually attach to either of these. I'm not sure why the test worked before, but it seems to be by pure chance: making a minor change in one of the script actors causes this to fail. Explicitly attaching to either the Chrome or TabActor makes the problem go away again. - If that were the only problem, we could simply fix the test. However, the test checks that it always takes about 100ms for the promise to settle. I don't understand how we can actually guarantee this, and it seems likely to me that in fact were not, and again this only happens to work by chance. After fixing the above issue, promise settle time occasionally rises to 200-300ms, causing the test to fail intermittently. Given these issues, I'd argue that the test is probably fundamentally broken, and needs to be rethought. Given that this test is blocking me on bug 1037992, I'd like to suggest that we disable it in the meantime.
Comment 2•9 years ago
|
||
What if we just assert time to settle is >= 100ms? I think that is much more sane.
Assignee | ||
Comment 3•9 years ago
|
||
(In reply to Nick Fitzgerald [:fitzgen][:nf] from comment #2) > What if we just assert time to settle is >= 100ms? I think that is much more > sane. If we can do that, that's fine with me too. In that case, we probably don't have to disable this test.
Assignee | ||
Comment 4•9 years ago
|
||
Comment on attachment 8665009 [details] [diff] [review] Disable test_promises_object_timetosettle-02.js Canceling review while I come up with a fix instead.
Attachment #8665009 -
Flags: review?(jryans)
Assignee | ||
Comment 5•9 years ago
|
||
Turns out I was just being stupid and didn't understand how ChromeActor works. Here's a patch that fixes the issues explained in comment #1. I've used your suggestion to check that time to settle is >= 100ms, which is indeed much more sane.
Attachment #8665009 -
Attachment is obsolete: true
Attachment #8685994 -
Flags: review?(nfitzgerald)
Assignee | ||
Updated•9 years ago
|
Summary: test_promises_object_timetosettle-02.js seems to be buggy → Fix a bug in test_promises_object_timetosettle-02.js.
Assignee | ||
Comment 6•9 years ago
|
||
Try run for this patch: https://treeherder.mozilla.org/#/jobs?repo=try&revision=51380b13972f
Assignee | ||
Updated•9 years ago
|
Comment 7•9 years ago
|
||
Comment on attachment 8685994 [details] [diff] [review] Fix a bug in test_promises_object_timetosettle-02.js. Review of attachment 8685994 [details] [diff] [review]: ----------------------------------------------------------------- Thanks! ::: devtools/server/tests/unit/test_promises_object_timetosettle-02.js @@ +24,5 @@ > > let response = yield listTabs(client); > let targetTab = findTab(response.tabs, "test-promises-timetosettle"); > ok(targetTab, "Found our target tab."); > + yield attachTab(client, targetTab); I think you may need to attach to the thread as well, for the tab's sources to show up. @@ +48,5 @@ > events.on(front, "promises-settled", promises => { > for (let p of promises) { > if (p.promiseState.state === "fulfilled" && > p.promiseState.value === resolution) { > + let timeToSettle = Math.floor(p.promiseState.timeToSettle / 100) * 100; I think you can remove the flooring and arithmetic here now.
Attachment #8685994 -
Flags: review?(nfitzgerald) → review+
Comment 9•9 years ago
|
||
bugherder |
https://hg.mozilla.org/mozilla-central/rev/dd627c83397a
Status: NEW → RESOLVED
Closed: 9 years ago
status-firefox45:
--- → fixed
Resolution: --- → FIXED
Target Milestone: --- → Firefox 45
Updated•6 years ago
|
Product: Firefox → DevTools
You need to log in
before you can comment on or make changes to this bug.
Description
•