Closed
Bug 1446050
Opened 6 years ago
Closed 6 years ago
Complete loss of Mozmill testing - Exception: Sorry, cannot connect to jsbridge extension, port 24242
Categories
(Thunderbird :: Testing Infrastructure, enhancement)
Thunderbird
Testing Infrastructure
Tracking
(Not tracked)
RESOLVED
FIXED
Thunderbird 61.0
People
(Reporter: jorgk-bmo, Assigned: jorgk-bmo)
Details
Attachments
(3 files, 7 obsolete files)
6.30 KB,
patch
|
aceman
:
review+
|
Details | Diff | Splinter Review |
1.29 KB,
patch
|
Fallen
:
review+
|
Details | Diff | Splinter Review |
2.87 KB,
patch
|
aceman
:
review+
|
Details | Diff | Splinter Review |
Sadly we lost all Mozmill testing today. In this Daily run https://treeherder.mozilla.org/#/jobs?repo=comm-central&revision=fc57e733b75a63884cc171f2b8256497ef7c0148 the Linux jobs ran on M-C fcb11e93adf57210167de0b27b15433e9c and failed, Windows ran on 68dfe5ee5b80ee99b7e389d739a30089f6 and succeeded. M-C last good: 68dfe5ee5b80ee99b7e389d739a30089f6 M-C first bad: fcb11e93adf57210167de0b27b15433e9c https://hg.mozilla.org/mozilla-central/pushloghtml?fromchange=68dfe5ee5b80ee99b7e389d739a30089f6&tochange=fcb11e93adf57210167de0b27b15433e9c This looks like bug 1445780. Apparently Mozmill uses the jsbridge extension which we know since we recently tweaked it here: https://hg.mozilla.org/comm-central/rev/6654b9108d7e46f720e1581b121bd2baa1a3f519#l4.12
Assignee | ||
Comment 1•6 years ago
|
||
https://taskcluster-artifacts.net/cdLMbG35QuiHJO4uXsPWGA/0/public/logs/live_backing.log says: INFO - JavaScript error: chrome://calendar/content/calendar-migration-dialog.js, line 13: NS_ERROR_NOT_AVAILABLE: Component returned failure code: 0x80040111 (NS_ERROR_NOT_AVAILABLE) [nsIXPCComponents_Utils.importGlobalProperties] INFO - JavaScript error: resource://mozmill/stdlib/json2.js, line 163: ReferenceError: assignment to undeclared variable JSON INFO - JavaScript error: resource://jsbridge/modules/json2.js, line 165: ReferenceError: assignment to undeclared variable JSON calendar-migration-dialog.js, line 13 is: Components.utils.importGlobalProperties(["XMLHttpRequest"]); and something like that was just changed here: https://hg.mozilla.org/mozilla-central/rev/a3631cb49bef#l6.6 -Cu.importGlobalProperties(["XMLHttpRequest"]); +// This test requires an XMLHttpRequest constructor which isn't +// associated with a window. +const {XMLHttpRequest} = Cu.Sandbox(window, {wantGlobalProperties: ["XMLHttpRequest"]}); So that would be the first thing to try. All other "jsbridge" errors in the log seem to appear in the same context. There are more |Components.utils.importGlobalProperties(["XMLHttpRequest"]);| in the code base, so we'll see whether they also fail: https://dxr.mozilla.org/comm-central/search?q=XMLHttpRequest&redirect=false
Assignee | ||
Comment 2•6 years ago
|
||
So this makes the Calendar error go away, but I still get: JavaScript error: resource://mozmill/stdlib/json2.js, line 163: ReferenceError: assignment to undeclared variable JSON JavaScript error: resource://jsbridge/modules/json2.js, line 165: ReferenceError: assignment to undeclared variable JSON and Traceback (most recent call last): File "runtest.py", line 523, in <module> ThunderTestCLI().run() File "c:\mozilla-source\comm-central\obj-x86_64-pc-mingw32\_tests\mozmill-virtualenv\lib\site-packages\mozmill\__init__.py", line 790, in run self.mozmill.start(runner=runner, profile=runner.profile) File "runtest.py", line 287, in start return super(ThunderTestMozmill, self).start(profile, runner) File "c:\mozilla-source\comm-central\obj-x86_64-pc-mingw32\_tests\mozmill-virtualenv\lib\site-packages\mozmill\__init__.py", line 230, in start self.create_network() File "c:\mozilla-source\comm-central\obj-x86_64-pc-mingw32\_tests\mozmill-virtualenv\lib\site-packages\mozmill\__init__.py", line 204, in create_network self.jsbridge_port) File "c:\mozilla-source\comm-central\obj-x86_64-pc-mingw32\_tests\mozmill-virtualenv\lib\site-packages\jsbridge\__init__.py", line 72, in wait_and_create_network raise Exception("Sorry, cannot connect to jsbridge extension, port %s" % port) Exception: Sorry, cannot connect to jsbridge extension, port 24242 mozmake: *** [c:/mozilla-source/comm-central/mozilla/../mail/testsuite-targets.mk:42: mozmill-one] Error 1
Flags: needinfo?(acelists)
Assignee | ||
Comment 3•6 years ago
|
||
Oops, quoted the wrong bug number, this is caused by bug 1445551.
Assignee | ||
Comment 4•6 years ago
|
||
Fixing the reference errors, I now get: [3856, Main Thread] WARNING: NS_ENSURE_TRUE(*out) failed: file c:/mozilla-source/comm-central/mozilla/js/xpconnect/src/Sandbox.cpp, line 1198 JavaScript error: resource://jsbridge/modules/server.js, line 204: NS_ERROR_ILLEGAL_VALUE: Illegal value which appears to come from: C:\mozilla-source\comm-central\mail\test\resources\jsbridge\jsbridge\extension\resource\modules\server.js Line 204 reads: this.sandbox = Cu.Sandbox(backstage, { wantGlobalProperties: ["ChromeUtils"] }); The final error has shifted to: jsbridge.network.JSBridgeDisconnectError: Connection timed out mozmake: *** [c:/mozilla-source/comm-central/mozilla/../mail/testsuite-targets.mk:42: mozmill-one] Error 1
Attachment #8959312 -
Attachment is obsolete: true
Assignee | ||
Comment 5•6 years ago
|
||
Reading Sandbox.cpp, line 1198 this comes from the first argument passed in. The comment above says: * For sandbox constructor the first argument can be a principal object or * a script object principal (Document, Window).
Assignee | ||
Comment 6•6 years ago
|
||
With this, I can run a Mozmill test. Sorry about a bit of unrelated clean-up. Try: https://treeherder.mozilla.org/#/jobs?repo=try-comm-central&revision=50003f40c0b83f18bb19fb030a60bc1eb0e5a149
Attachment #8959338 -
Attachment is obsolete: true
Flags: needinfo?(acelists)
Assignee | ||
Updated•6 years ago
|
Comment on attachment 8959350 [details] [diff] [review] 1446050-bustage.patch Review of attachment 8959350 [details] [diff] [review]: ----------------------------------------------------------------- Thanks, works also for me locally. ::: mail/test/resources/mozmill/mozmill/extension/resource/stdlib/json2.js @@ +158,5 @@ > var EXPORTED_SYMBOLS = ["JSON"]; > > // Create a JSON object only if one does not already exist. We create the > // object in a closure to avoid creating global variables. > I wonder why this file is missing the if (!this.JSON) guard the other json2.js has, while the comment about it is the same. We can try adding that in the next patch.
Attachment #8959350 -
Flags: review+
Pushed by mozilla@jorgk.com: https://hg.mozilla.org/comm-central/rev/08a841e8b1af Port bug 1445551 to TB: Remove compartment-per-add-on. r=aceman
Assignee | ||
Comment 9•6 years ago
|
||
Comment on attachment 8959350 [details] [diff] [review] 1446050-bustage.patch Hi Philipp, I'm sure you have more insights into this than the humble fire fighters. I'm happy to land a follow-up. The Calendar change is copied from: https://hg.mozilla.org/mozilla-central/rev/a3631cb49bef#l6.6 (see comment #1). I can't even make much sense of the comment.
Flags: needinfo?(philipp)
Attachment #8959350 -
Flags: review?(philipp)
Comment 10•6 years ago
|
||
Jörg, can you try to remove the importGlobalProperties line for calendar-migration-dialog? This is a script for a window, so there should be no need to import XHR.
Flags: needinfo?(philipp) → needinfo?(jorgk)
Assignee | ||
Comment 11•6 years ago
|
||
Sorry about the hasty landing of the bustage fix, but having *all* Mozmill red/orange wasn't much fun. I tried the removal on one Mozmill test locally and it passed. So here's a try: https://treeherder.mozilla.org/#/jobs?repo=try-comm-central&revision=b937c4c0c75cdecc92ffaf9edd5a1c688cda88d3 What is that calendar-migration-dialog.js about?
Flags: needinfo?(jorgk)
Attachment #8959471 -
Flags: review?(philipp)
Assignee | ||
Comment 12•6 years ago
|
||
That worked :-)
Assignee | ||
Updated•6 years ago
|
Keywords: leave-open
Updated•6 years ago
|
Attachment #8959471 -
Flags: review?(philipp) → review+
Updated•6 years ago
|
Attachment #8959350 -
Flags: review?(philipp)
Comment 13•6 years ago
|
||
Pushed by mozilla@jorgk.com: https://hg.mozilla.org/comm-central/rev/b7d028d0299c Follow-up: Remove import of XMLHttpRequest. r=philipp
Status: ASSIGNED → RESOLVED
Closed: 6 years ago
Resolution: --- → FIXED
Assignee | ||
Updated•6 years ago
|
Target Milestone: --- → Thunderbird 61.0
Comment 14•6 years ago
|
||
Add the check for JSON to get the json2.js files to sync in this. Try run: https://treeherder.mozilla.org/#/jobs?repo=try-comm-central&revision=45c7dbe5929bd291f865cd6e61a07429e1cc9510
Attachment #8959702 -
Flags: review?(jorgk)
Assignee | ||
Comment 15•6 years ago
|
||
Hmm, but obviously the check wasn't necessary. Why not try to remove the other one instead?
Comment 16•6 years ago
|
||
I'd think that the 'var' does the magic, if you declare the thing multiple times it may not matter. With the patch it may just be faster that we do not need to read the source of the thing again, when it already exists.
Assignee | ||
Comment 17•6 years ago
|
||
Comment on attachment 8959702 [details] [diff] [review] 1446050.patch Arai, can you please look at this. What is 'this' in this context? Note that we already have this code here: https://dxr.mozilla.org/comm-central/rev/a8eecfe6de793af00e98cb1488515199c5fb73fb/mail/test/resources/jsbridge/jsbridge/extension/resource/modules/json2.js#160 in another copy of this file.
Attachment #8959702 -
Flags: feedback?(arai.unmht)
Comment 18•6 years ago
|
||
(In reply to Jorg K (GMT+1) from comment #17) > Comment on attachment 8959702 [details] [diff] [review] > 1446050.patch > > Arai, can you please look at this. What is 'this' in this context? the global object. so, `this.JSON` is basically the same thing as referring global variable `JSON`.
Assignee | ||
Comment 19•6 years ago
|
||
Hmm, sorry to ask again: So does the patch make sense? We're checking the 'JSON' property of the global object and if not there, we assign 'var JSON = ...'; Note that previously there was no 'var', see: https://hg.mozilla.org/comm-central/rev/08a841e8b1af77cffce8eefa0eeced022d36d63a#l2.12 Back then, 'JSON' would have been a property of the global object, but now it's not any more? Sorry about my poor JS skills :-(
Comment 20•6 years ago
|
||
(In reply to Jorg K (GMT+1) from comment #19) > Hmm, sorry to ask again: So does the patch make sense? We're checking the > 'JSON' property of the global object and if not there, we assign 'var JSON = > ...'; if `this.JSON = ...` works, that looks consistent with the check. > Back then, 'JSON' would have been a property of the global object, but now > it's not any more? I'm not sure about that part. is the `!this.JSON` condition become true?
Comment 21•6 years ago
|
||
If this.JSON doesnt work, you can try Components.getGlobalForObject(this).JSON
Assignee | ||
Comment 22•6 years ago
|
||
(In reply to Philipp Kewisch [:Fallen] from comment #21) > If this.JSON doesnt work, you can try > Components.getGlobalForObject(this).JSON Thanks for your comment. To determine what "doesn't work" mean here, we first need to define what the desired effect is. I have the impression that the aim is to avoid parsing |var JSON = ...| more than once for performance reasons. I ran an entire Mozmill directory with the attached patch, and all I saw was: === modules: JSON was NOT defined === stdlib: JSON was NOT defined The other debug didn't show up at all. So is there any evidence that the patch does anything useful and not just add dead code which should actually be removed from the other copy?
Assignee | ||
Comment 23•6 years ago
|
||
Comment on attachment 8959702 [details] [diff] [review] 1446050.patch Please provide evidence that this does anything useful.
Attachment #8959702 -
Flags: review?(jorgk)
Attachment #8959702 -
Flags: feedback?(arai.unmht)
Comment 24•6 years ago
|
||
The idea was to sync the 2 copies of the file that we have in the tree and that the check should not hurt. It could help if we would be parsing the file multiple times. We we aren't right now, then that is great, but some robustness should hurt. I don't think adding one check should slow this down in any significant way. The current version of this 3rd party lib still has this guard and the comment: https://github.com/douglascrockford/JSON-js/blob/master/json2.js , albeit done in a different way, which I'm not sure prevents parsing of the whole code again. It may be that inside c-c we import this file as a jsm module, thus the added 'var EXPORTED_SYMBOLS = ["JSON"];' which may cause it only be parsed once (that is why it is cheap to import jsms into tons of other JS files).
Assignee | ||
Comment 25•6 years ago
|
||
OK, let's get this settled.
Attachment #8959702 -
Attachment is obsolete: true
Attachment #8960003 -
Flags: review+
Attachment #8960003 -
Flags: feedback?(acelists)
Assignee | ||
Comment 26•6 years ago
|
||
Typo.
Attachment #8960003 -
Attachment is obsolete: true
Attachment #8960003 -
Flags: feedback?(acelists)
Attachment #8960004 -
Flags: review+
Attachment #8960004 -
Flags: feedback?(acelists)
Comment 27•6 years ago
|
||
Comment on attachment 8960004 [details] [diff] [review] 1446050.patch - with a comment Review of attachment 8960004 [details] [diff] [review]: ----------------------------------------------------------------- Yes, that looks good ;)
Attachment #8960004 -
Flags: feedback?(acelists) → feedback+
Comment 28•6 years ago
|
||
Looking closer, this file only exists for environments where JSON is not defined. For c-c it is defined in all scopes I know of. With the JSM compartment changes, this.JSON used to point to the global JSON object. This is no longer the case (similar to how this.Array no longer worked). I think the intent will be to check if JSON is defined on the current global, in which case you can probably guard the implementation with if (typeof JSON == "undefined") or if (!Components.getGlobalForObject(this).JSON) If you run it with debug you will see that with these checks JSON *is* defined, in which case the native implementation is used instead of the one from json2.js, which I would say is favorable.
Assignee | ||
Comment 29•6 years ago
|
||
OK, this does what Philipp suggested. typeof JSON == "undefined" didn't work, but this does. The debug shows "we have JSON". Sadly the test then hangs and I get "Sorry, cannot connect to jsbridge extension, port 24242". So the conclusion seems to be that we need to use the JSON defined here and not the global JSON object.
Assignee | ||
Comment 30•6 years ago
|
||
So this is following Philipp's idea, use the global JSON if available.
Attachment #8959984 -
Attachment is obsolete: true
Attachment #8960004 -
Attachment is obsolete: true
Attachment #8960038 -
Attachment is obsolete: true
Attachment #8960039 -
Flags: review?(acelists)
Comment 31•6 years ago
|
||
Comment on attachment 8960039 [details] [diff] [review] 1446050.patch Review of attachment 8960039 [details] [diff] [review]: ----------------------------------------------------------------- Great, if this passes try :) ::: mail/test/resources/jsbridge/jsbridge/extension/resource/modules/json2.js @@ +160,4 @@ > > +if (!JSON) { > + dump("jsbridge/extension/resource/modules/json2.js: creating JSON object\n"); > + whitespace here
Attachment #8960039 -
Flags: review?(acelists) → review+
Assignee | ||
Comment 32•6 years ago
|
||
https://treeherder.mozilla.org/#/jobs?repo=try-comm-central&revision=72b6da0fe032f7a16feeb9d5c7dd3d282a055d4d I've noticed the white-space, removed in local copy.
Comment 33•6 years ago
|
||
|if (!JSON)| will fail with an exception if it is actually undefined.
Assignee | ||
Comment 34•6 years ago
|
||
Hmm, sorry, I tried var EXPORTED_SYMBOLS = ["JSON"]; var JSON = Cu.getGlobalForObject(this).JSONxx; // Note JSONxx here. if (!JSON) { dump("mozmill/extension/resource/stdlib/json2.js: creating JSON object\n"); So JSON should be undefined, right? My debug shows: mozmill/extension/resource/stdlib/json2.js: creating JSON object undefined is falsy, so !undefined should work, and it appears to work. What am I missing?
Flags: needinfo?(philipp)
Assignee | ||
Comment 35•6 years ago
|
||
OK, this is correct, as discussed on IRC.
Flags: needinfo?(philipp)
Comment 36•6 years ago
|
||
Pushed by mozilla@jorgk.com: https://hg.mozilla.org/comm-central/rev/69eb5fe79295 use global JSON if available. r=aceman
You need to log in
before you can comment on or make changes to this bug.
Description
•