Make remote agent part of default build

RESOLVED FIXED

Status

enhancement
P1
normal
RESOLVED FIXED
5 months ago
3 months ago

People

(Reporter: ato, Assigned: ato)

Tracking

(Blocks 5 bugs)

Details

Attachments

(5 attachments)

The remote agent as we landed it in
https://bugzilla.mozilla.org/show_bug.cgi?id=protocdp is not part
of the default build. In order for us to have TaskCluster test
jobs, we need to include the remote agent in the default build of
Nightly.

This approach is similar to that taken in the past with Marionette,
first in Firefox, then later in Fennec.

This would mean that

ac_add_options --enable-cdp

would still be required locally when built with official branding.

Blocks: puppeteer
Depends on: protocdp
Assignee: nobody → ato
Status: NEW → ASSIGNED
Priority: -- → P1
Blocks: 1540655
Depends on: 1542198
Depends on: 1542229

try: https://treeherder.mozilla.org/#/jobs?repo=try&revision=51aefa79212f11c4515504b733316e404276ffbe

test_Domains.js included and run, but a call to ChromeUtils.import()
of remote/domains/Domains.jsm fails.

Depends on: 1542861

I figured out the problem. Fix available in
https://bugzilla.mozilla.org/show_bug.cgi?id=1542861.

Once that lands, I will upload a patch here that enables the remote
agent on Firefox Nightly. We still need to wait for the security
review (tracked in https://bugzilla.mozilla.org/show_bug.cgi?id=1542229)
before we can proceed with landing it, however.

Blocks: 1526364
Depends on: 1543676
Depends on: 1543679

I’m changing the narrative of this bug from shipping the remote
agent in Nightly, to building it as part of the default build with
the remote.enabled preference turned off. I’ve filed
https://bugzilla.mozilla.org/show_bug.cgi?id=1544393 to track the
shipping of it in Nightly.

The work encompassed by this bug will be to first flip remote.enabled
to false, which is the usual thing we tend to do for new features,
and then imply --enabled-cdp for the default build. This means
we can have the tests on try flip the pref to true when needed,
unblocking https://bugzilla.mozilla.org/show_bug.cgi?id=1540655.

No longer blocks: puppeteer
No longer depends on: 1542229
Summary: Make remote agent part of Nightly-only build in CI → Make remote agent part of default build
Blocks: 1544393

The browser.fission.simulate preference is necessary when using
the child actor system, but the remote agent is not.

DONTBUILD

This disables the remote agent through flipping the remote.enabled
preference to false. This will cause the help text to disappear from
--help and the RemoteAgent#init() (in remote/RemoteAgent.jsm) to fail.

The previous commit disabled the remote agent by flipping the
remote.enabled preference to false. That prevented the remote
agent from initialising or being included in the --help message.

This patch implies --enable-cdp in the default Firefox build on Firefox
Nightly. Firefox for Android is not supported. This will cause
builds to include the remote agent component that lives under remote/.

Since the remote agent is disabled by default, users will first
have to set the remote.enabled preference to true in order to use it.

If you wish to explicitly opt out of including the remote agent
when building Firefox, you may do so by using the --disable-cdp
build flag in your mozconfig:

ac_add_options --disable-cdp

The remote debugger mochitest browser-chrome tests do not have to
be run in a separate subsuite. Removing the subsuite condition
will make them appear as part of the normal M-bc* jobs on try.

Blocks: 1545147

Apparently the test-verify (TV/Tvw) is nothing to worry about. The
first time I saw this was when using ./mach try fuzzy.

Full try:
https://treeherder.mozilla.org/#/jobs?repo=try&revision=3e90536469f537d19bccc02d42d51d113045ba32

Pushed by atolfsen@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/b818d6ca606d
remote: remove browser.fission.simulate pref; r=ochameau,yulia
https://hg.mozilla.org/integration/autoland/rev/bd363475667f
remote: disable remote agent; r=ochameau
https://hg.mozilla.org/integration/autoland/rev/d32384388e3d
remote: include remote agent in default build; r=firefox-build-system-reviewers,chmanchester
https://hg.mozilla.org/integration/autoland/rev/94fd0790781a
remote: run bc tests as part of regular batch; r=ochameau

Backed out 4 changesets (bug 1533831) for failing at /browser/browser_target.js on a CLOSED TREE.

Backout link: https://hg.mozilla.org/integration/autoland/rev/715ae7cfb2d11cc68f8a8d26ad5342d3cbf0ab17

Push with failures: https://treeherder.mozilla.org/#/jobs?repo=autoland&resultStatus=testfailed%2Cbusted%2Cexception&selectedJob=241077679&revision=2b2554ff8f8c3d87e5035316e67f3a213fd11c54

Log link: https://treeherder.mozilla.org/logviewer.html#/jobs?job_id=241077679&repo=autoland&lineNumber=71509

Log snippet:

01:12:46 INFO - TEST-INFO | started process screenshot
01:12:46 INFO - TEST-INFO | screenshot: exit 0
01:12:46 INFO - Buffered messages logged at 01:11:16
01:12:46 INFO - Entering test bound
01:12:46 INFO - Buffered messages logged at 01:11:17
01:12:46 INFO - TEST-PASS | remote/test/browser/browser_target.js | CDP client has been instantiated -
01:12:46 INFO - TEST-PASS | remote/test/browser/browser_target.js | Target domain is available -
01:12:46 INFO - Buffered messages finished
01:12:46 INFO - TEST-UNEXPECTED-FAIL | remote/test/browser/browser_target.js | Test timed out -
01:12:46 INFO - GECKO(5304) | MEMORY STAT | vsize 790MB | vsizeMaxContiguous 685MB | residentFast 219MB | heapAllocated 73MB
01:12:46 INFO - TEST-OK | remote/test/browser/browser_target.js | took 90043ms
01:12:46 INFO - Not taking screenshot here: see the one that was previously logged
01:12:46 INFO - TEST-UNEXPECTED-FAIL | remote/test/browser/browser_target.js | Found a tab after previous test timed out: about:blank -
01:12:46 INFO - GECKO(5304) | ++DOCSHELL 01461800 == 1 [pid = 1540] [id = {5f4ebea6-b1a5-42b6-a6e9-4103ab19f301}]
01:12:46 INFO - GECKO(5304) | ++DOMWINDOW == 1 (089203A0) [pid = 1540] [serial = 5] [outer = 00000000]
01:12:46 INFO - GECKO(5304) | ++DOMWINDOW == 2 (01468800) [pid = 1540] [serial = 6] [outer = 089203A0]
01:12:46 INFO - checking window state

Flags: needinfo?(ato)
Depends on: 1546385

(In reply to Raul Gurzau (:RaulGurzau) from comment #13)

01:12:46 INFO - TEST-UNEXPECTED-FAIL | remote/test/browser/browser_target.js | Found a tab after previous test timed out: about:blank -

Filed https://bugzilla.mozilla.org/show_bug.cgi?id=1546385 about this.

Flags: needinfo?(ato)
Pushed by atolfsen@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/c03450df8660
remote: remove browser.fission.simulate pref; r=ochameau,yulia
https://hg.mozilla.org/integration/autoland/rev/afcfdae88bf7
remote: disable remote agent; r=ochameau
https://hg.mozilla.org/integration/autoland/rev/57a319eeed2d
remote: include remote agent in default build; r=firefox-build-system-reviewers,chmanchester
https://hg.mozilla.org/integration/autoland/rev/a3014b38cc5f
remote: run bc tests as part of regular batch; r=ochameau

Push with failures: https://treeherder.mozilla.org/#/jobs?repo=autoland&selectedJob=242344215&searchStr=os%2Cx%2C10.10%2Cdebug%2Cxpcshell%2Ctests%2Ctest-macosx64%2Fdebug-xpcshell-e10s%2Cx%28x%29&revision=a3014b38cc5fa178942bdc40b33b30514c1f8f5a

Failure log: https://treeherder.mozilla.org/logviewer.html#/jobs?job_id=242344215&repo=autoland&lineNumber=7806

Backout link: https://hg.mozilla.org/integration/autoland/rev/2ff0f3923d0bc5f2f8b3721a0e18fa9b6215aff0

16:49:43 INFO - TEST-START | extensions/pref/autoconfig/test/unit/test_autoconfig_nonascii.js
16:49:44 INFO - TEST-PASS | extensions/pref/autoconfig/test/unit/test_autoconfig_nonascii.js | took 511ms
16:49:44 INFO - TEST-START | remote/test/unit/test_Error.js
16:49:44 WARNING - TEST-UNEXPECTED-FAIL | remote/test/unit/test_Error.js | xpcshell return code: 1
16:49:44 INFO - TEST-INFO took 343ms
16:49:44 INFO - >>>>>>>
16:49:44 INFO - PID 6297 | [6297, Main Thread] WARNING: NS_ENSURE_SUCCESS(rv, NS_ERROR_UNEXPECTED) failed with result 0x80004005: file /builds/worker/workspace/build/src/extensions/cookie/nsPermissionManager.cpp, line 1026
16:49:44 INFO - PID 6297 | [6297, Main Thread] WARNING: Couldn't get the user appdata directory. Crash events may not be produced.: file /builds/worker/workspace/build/src/toolkit/crashreporter/nsExceptionHandler.cpp, line 2528
16:49:44 INFO - (xpcshell/head.js) | test MAIN run_test pending (1)
16:49:44 INFO - (xpcshell/head.js) | test run_next_test 0 pending (2)
16:49:44 INFO - (xpcshell/head.js) | test MAIN run_test finished (2)
16:49:44 INFO - running event loop
16:49:44 INFO - PID 6297 | Couldn't convert chrome URL: chrome://branding/locale/brand.properties
16:49:44 INFO - PID 6297 | [6297, Main Thread] WARNING: Could not get the program name for a cubeb stream.: 'NS_SUCCEEDED(rv)', file /builds/worker/workspace/build/src/dom/media/CubebUtils.cpp, line 385
16:49:44 INFO - remote/test/unit/test_Error.js | Starting test_RemoteAgentError_ctor
16:49:44 INFO - (xpcshell/head.js) | test test_RemoteAgentError_ctor pending (2)
16:49:44 INFO - PID 6297 | 1556124584664 RemoteAgent ERROR RemoteAgentError:
16:49:44 INFO - PID 6297 | RemoteAgentError@chrome://remote/content/Error.jsm:23:5
16:49:44 INFO - PID 6297 | test_RemoteAgentError_ctor@/Users/cltbld/tasks/task_1556121558/build/tests/xpcshell/tests/remote/test/unit/test_Error.js:15:14
16:49:44 INFO - PID 6297 | _run_next_test@/Users/cltbld/tasks/task_1556121558/build/tests/xpcshell/head.js:1455:11
16:49:44 INFO - PID 6297 | run@/Users/cltbld/tasks/task_1556121558/build/tests/xpcshell/head.js:688:9
16:49:44 INFO - PID 6297 | _do_main@/Users/cltbld/tasks/task_1556121558/build/tests/xpcshell/head.js:227:6
16:49:44 INFO - PID 6297 | _execute_test@/Users/cltbld/tasks/task_1556121558/build/tests/xpcshell/head.js:529:5
16:49:44 INFO - PID 6297 | @-e:1:1
16:49:44 INFO - TEST-PASS | remote/test/unit/test_Error.js | test_RemoteAgentError_ctor - [test_RemoteAgentError_ctor : 16] "RemoteAgentError" == "RemoteAgentError"

Flags: needinfo?(ato)

The log pasted in comment #16 is misleading, the real cause is this:

16:50:28     INFO -  remote/test/unit/test_Error.js | Starting test_FatalError
16:50:28     INFO -  (xpcshell/head.js) | test test_FatalError pending (2)
16:50:28     INFO -  PID 6512 | 1556124627986	RemoteAgent	FATAL	FatalError:
16:50:28     INFO -  PID 6512 | 	RemoteAgentError@chrome://remote/content/Error.jsm:23:5
16:50:28     INFO -  PID 6512 | 	FatalError@chrome://remote/content/Error.jsm:54:5
16:50:28     INFO -  PID 6512 | 	test_FatalError@/Users/cltbld/tasks/task_1556121860/build/tests/xpcshell/tests/remote/test/unit/test_Error.js:86:13
16:50:28     INFO -  PID 6512 | 	_run_next_test@/Users/cltbld/tasks/task_1556121860/build/tests/xpcshell/head.js:1455:11
16:50:28     INFO -  PID 6512 | 	run@/Users/cltbld/tasks/task_1556121860/build/tests/xpcshell/head.js:688:9
16:50:28     INFO -  PID 6512 | 	_do_main@/Users/cltbld/tasks/task_1556121860/build/tests/xpcshell/head.js:227:6
16:50:28     INFO -  PID 6512 | 	_execute_test@/Users/cltbld/tasks/task_1556121860/build/tests/xpcshell/head.js:529:5
16:50:28     INFO -  PID 6512 | 	@-e:1:1
16:50:28     INFO -  PID 6512 | \x07[6512, Main Thread] ###!!! ASSERTION: consider quit stopper out of bounds: 'mConsiderQuitStopper > 0', file /builds/worker/workspace/build/src/toolkit/components/startup/nsAppStartup.cpp, line 493
16:50:28     INFO -  PID 6512 | [6512, Main Thread] ###!!! ASSERTION: consider quit stopper out of bounds: 'mConsiderQuitStopper > 0', file /builds/worker/workspace/build/src/toolkit/components/startup/nsAppStartup.cpp, line 493
16:50:28     INFO -  PID 6512 | Hit MOZ_CRASH() at /builds/worker/workspace/build/src/memory/mozalloc/mozalloc_abort.cpp:33
16:50:28     INFO -  <<<<<<<
16:50:28     INFO -  mozcrash Copy/paste: /Users/cltbld/tasks/task_1556121860/build/macosx64-minidump_stackwalk /var/folders/_k/dm4d4_ts22gdjgwr_zch3by800000x/T/xpc-other-4rPTTG/51353F49-8C43-4724-9B1D-27662A630A8B.dmp /Users/cltbld/tasks/task_1556121860/build/symbols
16:50:35     INFO -  mozcrash Saved minidump as /Users/cltbld/tasks/task_1556121860/build/blobber_upload_dir/51353F49-8C43-4724-9B1D-27662A630A8B.dmp
16:50:35     INFO -  mozcrash Saved app info as /Users/cltbld/tasks/task_1556121860/build/blobber_upload_dir/51353F49-8C43-4724-9B1D-27662A630A8B.extra
16:50:35  WARNING -  PROCESS-CRASH | remote/test/unit/test_Error.js | application crashed [@ mozalloc_abort]

FatalError uses Services.startup.quit and this is apparently
fine to run in an xpcshell test with an optimised build, but not
with a debug build where it causes MOZ_CRASH() to be hit.

I can’t think of any other solution than to remove the test
initialising FatalError.

Flags: needinfo?(ato)

FatalError uses Services.startup.quit and this is apparently fine
to run in an xpcshell test with an optimised build, but not with
debug builds where it causes MOZ_CRASH() to be hit.

This removes test_FatalError so that we can run test_Error.js on try.

Pushed by atolfsen@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/da2d4529a200
remote: remove browser.fission.simulate pref; r=ochameau,yulia
https://hg.mozilla.org/integration/autoland/rev/8d48c69e7f8e
remote: disable remote agent; r=ochameau
https://hg.mozilla.org/integration/autoland/rev/242ca1013e27
remote: include remote agent in default build; r=firefox-build-system-reviewers,chmanchester
https://hg.mozilla.org/integration/autoland/rev/fa67585a979d
remote: run bc tests as part of regular batch; r=ochameau
https://hg.mozilla.org/integration/autoland/rev/7c43ffcd5adc
remote: remove test_FatalError; r=ochameau
Blocks: 1546945
You need to log in before you can comment on or make changes to this bug.