Open Bug 1709961 Opened 5 years ago Updated 1 month ago

[meta] Fix xpcshell tests for isolated process

Categories

(GeckoView :: General, task, P2)

Unspecified
All
task

Tracking

(Not tracked)

People

(Reporter: owlish, Unassigned)

References

(Depends on 1 open bug, Blocks 1 open bug)

Details

(Keywords: meta, Whiteboard: [sandboxing] [geckoview:2022q3] [fxdroid] [geckoview] )

Tests affected:

  • xpcshell tests X(X)

Once fixed, these should be enabled in automation (i.e. have the same tier in sandboxed builds as in non-sandboxed builds of the same type)

Severity: -- → S3
Priority: -- → P2
Whiteboard: [geckoview:m91?]
Whiteboard: [geckoview:m91?]
Whiteboard: [geckoview:2022q3?]
Whiteboard: [geckoview:2022q3?] → [sandboxing] [geckoview:2022q3]

Moving isolated process bugs to the new GeckoView::Sandboxing component.

Component: General → Sandboxing

Tasks should have severity N/A.

Severity: S3 → N/A
Component: Sandboxing → General
Whiteboard: [sandboxing] [geckoview:2022q3] → [sandboxing] [geckoview:2022q3] [fxdroid] [geckoview]

Sent a try run to see the current state of these tests. I'll revisit and summarize later this week.

Flags: needinfo?(ohall)

Current Failures:

X(3)

  • TEST-UNEXPECTED-TIMEOUT | netwerk/test/unit_ipc/test_alt-data_closeWithStatus_wrap.js
  • TEST-UNEXPECTED-TIMEOUT | netwerk/test/unit_ipc/test_alt-data_simple_wrap.js | Test timed out
  • TEST-UNEXPECTED-TIMEOUT | netwerk/test/unit_ipc/test_cache-entry-id_wrap.js | Test timed out
  • TEST-UNEXPECTED-TIMEOUT | netwerk/test/unit_ipc/test_httpcancel_wrap.js | Test timed out
  • TEST-UNEXPECTED-TIMEOUT | netwerk/test/unit_ipc/test_redirect-caching_failure_wrap.js | Test timed out
  • TEST-UNEXPECTED-TIMEOUT | netwerk/test/unit_ipc/test_redirect_veto_parent.js | Test timed out

X(4)

  • PROCESS-CRASH | application crashed [None] | xpcshell-remote.toml:toolkit/components/extensions/test/xpcshell/test_ext_background_early_shutdown.js
  • PROCESS-CRASH | application crashed [None] | xpcshell-remote.toml:toolkit/components/extensions/test/xpcshell/test_ext_storage_session.js
  • TEST-UNEXPECTED-FAIL | xpcshell-remote.toml:toolkit/components/extensions/test/xpcshell/test_ext_l10n.js | xpcshell return code: 0
  • TEST-UNEXPECTED-FAIL | xpcshell-remote.toml:toolkit/components/extensions/test/xpcshell/test_ext_l10n.js | test_l10n_dom - [test_l10n_dom : 93] Translation succeeded in privileged extension - false == true
  • TEST-UNEXPECTED-TIMEOUT | xpcshell-remote.toml:toolkit/components/extensions/test/xpcshell/test_ext_experiments.js | Test timed out
Flags: needinfo?(ohall)
See Also: → 1975028

To help with unskipping the failing extension tests, I looked at the reported failures.
It looks like the failures are all related to files not being visible to a different process.

The first three failing files could potentially be issues specific to the test setup, but the failure in test_ext_experiments.js looks really unexpected and could potentially reflect an actual implementation issue.

test_ext_background_early_shutdown.js & test_ext_storage_session.js

  • PROCESS-CRASH | application crashed [None] | xpcshell-remote.toml:toolkit/components/extensions/test/xpcshell/test_ext_background_early_shutdown.js
  • PROCESS-CRASH | application crashed [None] | xpcshell-remote.toml:toolkit/components/extensions/test/xpcshell/test_ext_storage_session.js

Both tests trigger crashes to verify reasonable recovery behavior. To avoid tripping up the test runner, setup_crash_reporter_override_and_cleaner detects crash dumps in order to remove them from the filesystem.

test_ext_l10n.js

  • TEST-UNEXPECTED-FAIL | xpcshell-remote.toml:toolkit/components/extensions/test/xpcshell/test_ext_l10n.js | xpcshell return code: 0
  • TEST-UNEXPECTED-FAIL | xpcshell-remote.toml:toolkit/components/extensions/test/xpcshell/test_ext_l10n.js | test_l10n_dom - [test_l10n_dom : 93] Translation succeeded in privileged extension - false == true

The fuller error from the logs is:

"CONSOLE_MESSAGE: (warn) [JavaScript Warning: "Missing resource in locale en-US: test.ftl"]"
"CONSOLE_MESSAGE: (warn) [JavaScript Warning: "[fluent] Couldn't find a message: key" {file: "moz-extension://6b1173c2-4f9f-46b5-a8da-1a5dc3433e17/page.html" line: 0}]"
TEST-UNEXPECTED-FAIL | xpcshell-remote.toml:toolkit/components/extensions/test/xpcshell/test_ext_l10n.js | test_l10n_dom - [test_l10n_dom : 93] Translation succeeded in privileged extension - false == true

The test setup writes a file to disk and registers that local file with the expectation of it being available across child processes (the extension process in particular).

test_ext_experiments.js

  • TEST-UNEXPECTED-TIMEOUT | xpcshell-remote.toml:toolkit/components/extensions/test/xpcshell/test_ext_experiments.js | Test timed out

The log viewer doesn't show any useful information, but I downloaded the logcat file and filtered it to exclude logspam from bug 1844829 (2M lines out of 2.4M are logspam, 481 MB -> 97 MB):

07-01 20:11:29.056 17741 17762 I Gecko   : {"action":"test_status","time":1751400689056,"thread":null,"pid":null,"source":"xpcshell/head.js","test":"xpcshell-remote.toml:toolkit/components/extensions/test/xpcshell/test_ext_experiments.js","subtest":"test_unbundled_experiments","status":"PASS","message":"[test_unbundled_experiments : 144] typeof browser.experiments - Expected: object, Actual: object - true == true"}
07-01 20:11:29.061 17741 17762 I Gecko   : {"action":"test_status","time":1751400689061,"thread":null,"pid":null,"source":"xpcshell/head.js","test":"xpcshell-remote.toml:toolkit/components/extensions/test/xpcshell/test_ext_experiments.js","subtest":"test_unbundled_experiments","status":"PASS","message":"[test_unbundled_experiments : 144] typeof browser.experiments.foo - Expected: object, Actual: object - true == true"}
07-01 20:11:29.065 17741 17762 I Gecko   : {"action":"test_status","time":1751400689065,"thread":null,"pid":null,"source":"xpcshell/head.js","test":"xpcshell-remote.toml:toolkit/components/extensions/test/xpcshell/test_ext_experiments.js","subtest":"test_unbundled_experiments","status":"PASS","message":"[test_unbundled_experiments : 144] typeof browser.experiments.foo.child - Expected: function, Actual: function - true == true"}
07-01 20:11:29.067 17741 17762 I Gecko   : {"action":"test_status","time":1751400689067,"thread":null,"pid":null,"source":"xpcshell/head.js","test":"xpcshell-remote.toml:toolkit/components/extensions/test/xpcshell/test_ext_experiments.js","subtest":"test_unbundled_experiments","status":"PASS","message":"[test_unbundled_experiments : 144] typeof browser.experiments.foo.parent - Expected: function, Actual: function - true == true"}
07-01 20:11:29.070 17741 17762 I Gecko   : {"action":"test_status","time":1751400689070,"thread":null,"pid":null,"source":"xpcshell/head.js","test":"xpcshell-remote.toml:toolkit/components/extensions/test/xpcshell/test_ext_experiments.js","subtest":"test_unbundled_experiments","status":"PASS","message":"[test_unbundled_experiments : 144] foo.child() - Expected: child, Actual: child - true == true"}
07-01 20:11:29.086 17797 17814 E WebExtensions: [JavaScript Error: "uncaught exception: Error opening input stream (invalid filename?): jar:file:///data/local/tmp/test_root/xpc/p/075eef98-6c61-489e-a5e9-5f404dba5f20/temp/generated-extension-1.xpi!/child.js" {file: "moz-extension://05cd66f0-93eb-4960-a143-adcef1347a6e/%7Bc879248e-c25b-446c-a4ba-22e659864a1b%7D.js" line: 73}]
07-01 20:11:29.086 17797 17814 E WebExtensions: background@moz-extension://05cd66f0-93eb-4960-a143-adcef1347a6e/%7Bc879248e-c25b-446c-a4ba-22e659864a1b%7D.js:73:3
07-01 20:11:29.086 17797 17814 E WebExtensions: async*@moz-extension://05cd66f0-93eb-4960-a143-adcef1347a6e/%7Bc879248e-c25b-446c-a4ba-22e659864a1b%7D.js:73:5
07-01 20:11:29.097 17741 17762 D GeckoViewConsole: onExtensionReady {ed34fa23-c3fc-44ee-a512-3a6349ac99cf}
07-01 20:11:29.106 17741 17762 I Gecko   : {"action":"test_status","time":1751400689106,"thread":null,"pid":null,"source":"xpcshell/head.js","test":"xpcshell-remote.toml:toolkit/components/extensions/test/xpcshell/test_ext_experiments.js","subtest":"test_unbundled_experiments","status":"PASS","message":"[test_unbundled_experiments : 144] await foo.parent() - Expected: parent, Actual: parent - true == true"}
07-01 20:11:29.107 17741 17762 I Gecko   : {"action":"test_status","time":1751400689107,"thread":null,"pid":null,"source":"xpcshell/head.js","test":"xpcshell-remote.toml:toolkit/components/extensions/test/xpcshell/test_ext_experiments.js","subtest":"test_unbundled_experiments","status":"PASS","message":"[test_unbundled_experiments : 144] typeof browser.experiments.crunk - Expected: object, Actual: object - true == true"}
07-01 20:11:29.109 17741 17762 I Gecko   : {"action":"log","time":1751400689108,"thread":null,"pid":null,"source":"xpcshell/head.js","level":"INFO","message":"\"CONSOLE_MESSAGE: (error) [JavaScript Error: \"uncaught exception: Error opening input stream (invalid filename?): jar:file:///data/local/tmp/test_root/xpc/p/075eef98-6c61-489e-a5e9-5f404dba5f20/temp/generated-extension-1.xpi!/child.js\" {file: \"moz-extension://05cd66f0-93eb-4960-a143-adcef1347a6e/%7Bc879248e-c25b-446c-a4ba-22e659864a1b%7D.js\" line: 73}]\nbackground@moz-extension://05cd66f0-93eb-4960-a143-adcef1347a6e/%7Bc879248e-c25b-446c-a4ba-22e659864a1b%7D.js:73:3\nasync*@moz-extension://05cd66f0-93eb-4960-a143-adcef1347a6e/%7Bc879248e-c25b-446c-a4ba-22e659864a1b%7D.js:73:5\n\""}

The log show that an error is thrown while executing typeof browser.experiments.crunk.child because the child.js file declared in apiExtension cannot be loaded: uncaught exception: Error opening input stream (invalid filename?): jar:file:///data/local/tmp/test_root/xpc/p/075eef98-6c61-489e-a5e9-5f404dba5f20/temp/generated-extension-1.xpi!/child.js.

Oddly enough, other tests in the file also load (a different) child.js in the extension process, which works just fine.

Metadata for these failures is now established and can be found tagged to this bug 1709961.

Keywords: meta
Summary: Fix xpcshell tests for isolated process → [meta] Fix xpcshell tests for isolated process
Depends on: 1698178
See Also: → 1988531
See Also: → 2005740

Looking further into these, the netwerk/test/unit_ipc tests now appear to pass and can be re-enabled.

For test_ext_background_early_shutdown.js and test_ext_storage_session.js, setup_crash_reporter_override_and_cleaner does not remove the dumps because they are missing crash annotations, so it cannot verify that they belong to the crashes the test caused:

Checking whether dumpID 535f0f83-5f93-edef-a6ac-890fd6592d26 should be removed
Keeping /data/local/tmp/test_root/xpc/minidumps/44506c18-788e-45e7-998a-023085882a7e/535f0f83-5f93-edef-a6ac-890fd6592d26.dmp; we did not trigger the crash
Checking whether dumpID 0625a371-ecad-2bbb-5d5a-8805ac305259 should be removed
Keeping /data/local/tmp/test_root/xpc/minidumps/44506c18-788e-45e7-998a-023085882a7e/0625a371-ecad-2bbb-5d5a-8805ac305259.dmp; we did not trigger the crash
Removed 0 crash dumps out of 2

Meaning the test ends with unexplained crash dumps present, and fails. These should be fixed by bug 1698178.

For test_ext_l10n.js and test_ext_experiments.js I'll file bugs blocking this.

Depends on: 2081762
Depends on: 2081770
Depends on: 2081772
You need to log in before you can comment on or make changes to this bug.