Closed Bug 1600330 Opened 3 years ago Closed 3 years ago

Write tests for nsIRemoteAgent interface

Categories

(Remote Protocol :: Agent, task, P1)

task

Tracking

(firefox73 fixed)

RESOLVED FIXED
Tracking Status
firefox73 --- fixed

People

(Reporter: ato, Assigned: ato)

References

Details

(Whiteboard: [puppeteer-beta-mvp])

Attachments

(2 files)

It was pointed out in https://phabricator.services.mozilla.com/D55177
that we don’t have tests for nsIRemoteAgent.

Because it is arguably such a key part of our infrastructure, we should have that.

Depends on: 1590828
Priority: -- → P3
Whiteboard: [puppeteer-alpha-reserve]

We probably want to write this test against the defaults, meaning remote.enabled should only sparingly be overridden.

Assignee: nobody → ato
Status: NEW → ASSIGNED
Depends on: 1544393
Priority: P3 → P1

fail() will cause a test assertion failure equivalent to ok(false).

Adds browser-chrome tests for the main entry point of the remote
agent, nsIRemoteAgent.

add_agent_task() wraps add_plain_task() (which again wraps the
original add_task()) so we can ensure that the agent isn't listening
before a test runs, and that any modified state such as preferences
is reset afterwards.

The tests rely heavily on the assumption that nsIRemoteAgent.close()
behaves as a no-op when the server is not listening.

This patch is a follow-up to bug 1590828.

Pushed by atolfsen@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/695a3213e7fd
remote: add fail() browser-chrome test helper r=remote-protocol-reviewers,maja_zf
https://hg.mozilla.org/integration/autoland/rev/eef79aaf5378
remote: test nsIRemoteAgent r=remote-protocol-reviewers,maja_zf,whimboo

Backed out 2 changesets (bug 1600330) for failing at browser_agent.js on a CLOSED TREE.

Backout link: https://hg.mozilla.org/integration/autoland/rev/7a14672fc95d4881869efb191010e08bbbfdd4cf

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

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

Log snippet:

[task 2019-12-03T18:34:37.763Z] 18:34:37 INFO - TEST-START | remote/test/browser/browser_agent.js
[task 2019-12-03T18:34:37.919Z] 18:34:37 INFO - TEST-INFO | started process screenshot
[task 2019-12-03T18:34:37.982Z] 18:34:37 INFO - TEST-INFO | screenshot: exit 0
[task 2019-12-03T18:34:37.982Z] 18:34:37 INFO - Buffered messages logged at 18:34:37
[task 2019-12-03T18:34:37.983Z] 18:34:37 INFO - Entering test bound
[task 2019-12-03T18:34:37.983Z] 18:34:37 INFO - TEST-PASS | remote/test/browser/browser_agent.js | Agent is not listening -
[task 2019-12-03T18:34:37.984Z] 18:34:37 INFO - TEST-PASS | remote/test/browser/browser_agent.js | Agent is listening -
[task 2019-12-03T18:34:37.984Z] 18:34:37 INFO - Leaving test bound
[task 2019-12-03T18:34:37.984Z] 18:34:37 INFO - Entering test bound
[task 2019-12-03T18:34:37.985Z] 18:34:37 INFO - TEST-PASS | remote/test/browser/browser_agent.js | remote-listening observer not notified -
[task 2019-12-03T18:34:37.985Z] 18:34:37 INFO - TEST-PASS | remote/test/browser/browser_agent.js | expected default port 49405, but got 49405 -
[task 2019-12-03T18:34:37.985Z] 18:34:37 INFO - Leaving test bound
[task 2019-12-03T18:34:37.985Z] 18:34:37 INFO - Entering test bound
[task 2019-12-03T18:34:37.986Z] 18:34:37 INFO - Buffered messages finished
[task 2019-12-03T18:34:37.986Z] 18:34:37 INFO - TEST-UNEXPECTED-FAIL | remote/test/browser/browser_agent.js | undefined assertion name - Got undefined, expected 2147746065
[task 2019-12-03T18:34:37.986Z] 18:34:37 INFO - Stack trace:
[task 2019-12-03T18:34:37.986Z] 18:34:37 INFO - chrome://mochikit/content/browser-test.js:test_is:1314
[task 2019-12-03T18:34:37.986Z] 18:34:37 INFO - chrome://mochitests/content/browser/remote/test/browser/browser_agent.js:listenWhenDisabled:56
[task 2019-12-03T18:34:37.987Z] 18:34:37 INFO - chrome://mochitests/content/browser/remote/test/browser/browser_agent.js:add_agent_task/<:17
[task 2019-12-03T18:34:37.987Z] 18:34:37 INFO - chrome://mochikit/content/browser-test.js:Tester_execTest/<:1069
[task 2019-12-03T18:34:37.987Z] 18:34:37 INFO - chrome://mochikit/content/browser-test.js:Tester_execTest:1104
[task 2019-12-03T18:34:37.988Z] 18:34:37 INFO - chrome://mochikit/content/browser-test.js:nextTest/<:932
[task 2019-12-03T18:34:37.988Z] 18:34:37 INFO - chrome://mochikit/content/tests/SimpleTest/SimpleTest.js:SimpleTest.waitForFocus/waitForFocusInner/focusedOrLoaded/<:805
[task 2019-12-03T18:34:37.988Z] 18:34:37 INFO - Not taking screenshot here: see the one that was previously logged
[task 2019-12-03T18:34:37.989Z] 18:34:37 INFO - TEST-UNEXPECTED-FAIL | remote/test/browser/browser_agent.js | undefined assertion name - Got Remote agent is disabled by preference, expected Disabled by preference
[task 2019-12-03T18:34:37.989Z] 18:34:37 INFO - Stack trace:
[task 2019-12-03T18:34:37.989Z] 18:34:37 INFO - chrome://mochikit/content/browser-test.js:test_is:1314
[task 2019-12-03T18:34:37.989Z] 18:34:37 INFO - chrome://mochitests/content/browser/remote/test/browser/browser_agent.js:listenWhenDisabled:57
[task 2019-12-03T18:34:37.989Z] 18:34:37 INFO - chrome://mochitests/content/browser/remote/test/browser/browser_agent.js:add_agent_task/<:17
[task 2019-12-03T18:34:37.989Z] 18:34:37 INFO - chrome://mochikit/content/browser-test.js:Tester_execTest/<:1069
[task 2019-12-03T18:34:37.989Z] 18:34:37 INFO - chrome://mochikit/content/browser-test.js:Tester_execTest:1104
[task 2019-12-03T18:34:37.989Z] 18:34:37 INFO - chrome://mochikit/content/browser-test.js:nextTest/<:932

Flags: needinfo?(ato)

test-verify errors due to patches landing in wrong order.

Flags: needinfo?(ato)
Pushed by atolfsen@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/11891679d4e9
remote: add fail() browser-chrome test helper r=remote-protocol-reviewers,maja_zf
https://hg.mozilla.org/integration/autoland/rev/309384fdbe94
remote: test nsIRemoteAgent r=remote-protocol-reviewers,maja_zf,whimboo
Status: ASSIGNED → RESOLVED
Closed: 3 years ago
Resolution: --- → FIXED
Whiteboard: [puppeteer-alpha-reserve] → [puppeteer-beta-mvp]
Regressions: 1603930
You need to log in before you can comment on or make changes to this bug.