Closed
Bug 1386357
Opened 7 years ago
Closed 7 years ago
Stop using sdk/timers in DevTools codebase
Categories
(DevTools :: General, enhancement, P1)
DevTools
General
Tracking
(firefox57 fixed)
RESOLVED
FIXED
Firefox 57
Tracking | Status | |
---|---|---|
firefox57 | --- | fixed |
People
(Reporter: ochameau, Assigned: jdescottes)
References
Details
(Whiteboard: [reserve-nosdk])
Attachments
(2 files)
http://searchfox.org/mozilla-central/search?q=sdk%2Ftimers&path=devtools%2F There is still a couple of tests using it.
Updated•7 years ago
|
Whiteboard: [nosdk]
Comment 1•7 years ago
|
||
search: http://searchfox.org/mozilla-central/search?q=sdk%2Ftimers&path=devtools%2F files: * devtools/client/canvasdebugger/test/head.js * devtools/client/framework/test/browser_browser_toolbox_debugger.js * devtools/server/tests/unit/test_promises_object_timetosettle-02.js * devtools/shared/discovery/tests/unit/test_discovery.js
Assignee | ||
Updated•7 years ago
|
Assignee: nobody → jdescottes
Status: NEW → ASSIGNED
Comment hidden (mozreview-request) |
Assignee | ||
Comment 3•7 years ago
|
||
try: https://treeherder.mozilla.org/#/jobs?repo=try&revision=9adf6312b79ca88de93ca65f7f710ec60fbc6b94 For the record devtools/client/framework/test/browser_browser_toolbox_debugger.js is permafailing for me locally, both with or without my change.
Updated•7 years ago
|
Whiteboard: [nosdk] → [nosdk] [triage]
Updated•7 years ago
|
Flags: qe-verify?
Priority: -- → P1
Whiteboard: [nosdk] [triage] → [reserve-nosdk]
Target Milestone: --- → Firefox 57
Updated•7 years ago
|
Flags: qe-verify? → qe-verify-
Assignee | ||
Comment 4•7 years ago
|
||
ochameau: Following our chat on #devtools about tests failing in isolation because devtools is not initialized, I checked for devtools/client/framework/test/browser_browser_toolbox_debugger.js ... and it still fails even if devtools init is forced in devtools-startup.
Reporter | ||
Comment 5•7 years ago
|
||
mozreview-review |
Comment on attachment 8892840 [details] Bug 1386357 - remove usage of sdk/timers in DevTools; https://reviewboard.mozilla.org/r/163852/#review169644 ::: devtools/client/canvasdebugger/test/head.js:9 (Diff revision 1) > > var { classes: Cc, interfaces: Ci, utils: Cu, results: Cr } = Components; > > var { generateUUID } = Cc["@mozilla.org/uuid-generator;1"].getService(Ci.nsIUUIDGenerator); > var { require } = Cu.import("resource://devtools/shared/Loader.jsm", {}); > +var { setTimeout } = Cu.import("resource://gre/modules/Timer.jsm", {}); From mochitest, you should be able to pull setTimeout from window: var { setTimeout } = window; In head.js, you don't have setTimeout set as global, it is unclear why, but you do have it in test scripts as it evaluates in the scope of the top level browser window and have access to all its globals... Feel free to keep the Timer.jsm if you find it better. ::: devtools/client/framework/test/browser_browser_toolbox_debugger.js:13 (Diff revision 1) > // chrome://mochitests/ package isn't available from browser toolbox process. > > // On debug test runner, it takes about 50s to run the test. > requestLongerTimeout(4); > > -const { setInterval, clearInterval } = require("sdk/timers"); > +const { setInterval, clearInterval } = Cu.import("resource://gre/modules/Timer.jsm", {}); As this is a mochitest test script, this import is useless, you already have setInterval/clearInteval in this scope.
Attachment #8892840 -
Flags: review?(poirot.alex) → review+
Reporter | ||
Comment 6•7 years ago
|
||
(In reply to Julian Descottes [:jdescottes] from comment #3) > For the record > devtools/client/framework/test/browser_browser_toolbox_debugger.js is > permafailing for me locally, both with or without my change. I got it to fail only once, the first time I tried it :/ Is it a permafail for you? I got this failure: 4 INFO TEST-UNEXPECTED-FAIL | devtools/client/framework/test/browser_browser_toolbox_debugger.js | Uncaught exception - at resource://gre/modules/commonjs/toolkit/loader.js -> resource://devtools/shared/DevToolsUtils.js:453 - Error: Failed to fetch chrome://mochitests/content/browser/devtools/client/framework/test/../../debugger/new/test/mochitest/head.js. Code 2152857618.
Comment hidden (mozreview-request) |
Assignee | ||
Comment 8•7 years ago
|
||
mozreview-review-reply |
Comment on attachment 8892840 [details] Bug 1386357 - remove usage of sdk/timers in DevTools; https://reviewboard.mozilla.org/r/163852/#review169644 > From mochitest, you should be able to pull setTimeout from window: > var { setTimeout } = window; > In head.js, you don't have setTimeout set as global, it is unclear why, but you do have it in test scripts as it evaluates in the scope of the top level browser window and have access to all its globals... > > Feel free to keep the Timer.jsm if you find it better. Seems like setTimeout is actually defined in head.js ? I tried dump()ing it early and it seems to be defined from the beginning. try: https://treeherder.mozilla.org/#/jobs?repo=try&revision=19d08a95cd7559a983a08fc096d5d244eb6e1e6a
Assignee | ||
Comment 9•7 years ago
|
||
(In reply to Alexandre Poirot [:ochameau] from comment #6) > (In reply to Julian Descottes [:jdescottes] from comment #3) > > For the record > > devtools/client/framework/test/browser_browser_toolbox_debugger.js is > > permafailing for me locally, both with or without my change. > > I got it to fail only once, the first time I tried it :/ > > Is it a permafail for you? > > I got this failure: > 4 INFO TEST-UNEXPECTED-FAIL | > devtools/client/framework/test/browser_browser_toolbox_debugger.js | > Uncaught exception - at resource://gre/modules/commonjs/toolkit/loader.js -> > resource://devtools/shared/DevToolsUtils.js:453 - Error: Failed to fetch > chrome://mochitests/content/browser/devtools/client/framework/test/../../ > debugger/new/test/mochitest/head.js. Code 2152857618. Yes same failure, and it seems to consistently fail for me. I will investigate.
Comment hidden (mozreview-request) |
Assignee | ||
Comment 11•7 years ago
|
||
Adding the new debugger head file to the support files for this test suite fixes the issue for me.
Reporter | ||
Comment 12•7 years ago
|
||
mozreview-review |
Comment on attachment 8893376 [details] Bug 1386357 - add new debugger head to support files for browser_browser_toolbox_debugger.js; https://reviewboard.mozilla.org/r/164482/#review169760 ::: devtools/client/debugger/new/test/mochitest/head.js:40 (Diff revision 1) > // shared-head.js handles imports, constants, and utility functions > Services.scriptloader.loadSubScript( > "chrome://mochitests/content/browser/devtools/client/framework/test/shared-head.js", > this > ); > +// yolo It looks like you should look into pre-commit hooks to prevent these things! https://github.com/git/git/blob/master/templates/hooks--pre-commit.sample ::: devtools/client/framework/test/browser.ini:45 (Diff revision 1) > browser_toolbox_options_enable_serviceworkers_testing.html > serviceworker.js > sjs_code_reload.sjs > sjs_code_bundle_reload_map.sjs > test_browser_toolbox_debugger.js > + !/devtools/client/debugger/new/test/mochitest/head.js I'm wondering if we can have the same error because of shared-head also missing from supports-file? Why does it work fine with shared-head and not debugger's head?!
Attachment #8893376 -
Flags: review?(poirot.alex) → review+
Comment hidden (mozreview-request) |
Assignee | ||
Comment 14•7 years ago
|
||
mozreview-review-reply |
Comment on attachment 8893376 [details] Bug 1386357 - add new debugger head to support files for browser_browser_toolbox_debugger.js; https://reviewboard.mozilla.org/r/164482/#review169760 > It looks like you should look into pre-commit hooks to prevent these things! > > https://github.com/git/git/blob/master/templates/hooks--pre-commit.sample Damn... I blame the weather. > I'm wondering if we can have the same error because of shared-head also missing from supports-file? > Why does it work fine with shared-head and not debugger's head?! shared-head is in the same folder and is already in supports-file: http://searchfox.org/mozilla-central/rev/f0e4ae5f8c40ba742214e89aba3f554da0b89a33/devtools/client/framework/test/browser.ini#34
Comment 15•7 years ago
|
||
Pushed by jdescottes@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/de883798a9c4 remove usage of sdk/timers in DevTools;r=ochameau https://hg.mozilla.org/integration/autoland/rev/dbc1163e84d5 add new debugger head to support files for browser_browser_toolbox_debugger.js;r=ochameau
Reporter | ||
Comment 16•7 years ago
|
||
(In reply to Julian Descottes [:jdescottes] from comment #14) > > I'm wondering if we can have the same error because of shared-head also missing from supports-file? > > Why does it work fine with shared-head and not debugger's head?! > > shared-head is in the same folder and is already in supports-file: > http://searchfox.org/mozilla-central/rev/ > f0e4ae5f8c40ba742214e89aba3f554da0b89a33/devtools/client/framework/test/ > browser.ini#34 As debugger's head.js? http://searchfox.org/mozilla-central/source/devtools/client/debugger/test/mochitest/browser.ini#130
Comment 17•7 years ago
|
||
bugherder |
https://hg.mozilla.org/mozilla-central/rev/de883798a9c4 https://hg.mozilla.org/mozilla-central/rev/dbc1163e84d5
Updated•6 years ago
|
Product: Firefox → DevTools
You need to log in
before you can comment on or make changes to this bug.
Description
•