Intermittent toolkit/components/extensions/test/xpcshell/test_ext_contentscript_order.js | single tracking bug
Categories
(WebExtensions :: General, defect, P5)
Tracking
(firefox140 fixed)
| Tracking | Status | |
|---|---|---|
| firefox140 | --- | fixed |
People
(Reporter: intermittent-bug-filer, Assigned: robwu)
References
Details
(Keywords: intermittent-failure, intermittent-testcase, Whiteboard: [addons-jira])
Attachments
(1 file)
Filed by: chorotan [at] mozilla.com
Parsed log: https://treeherder.mozilla.org/logviewer?job_id=504353767&repo=mozilla-central
Full log: https://firefox-ci-tc.services.mozilla.com/api/queue/v1/task/O5kaTSsHRAOS0eFasDNWXA/runs/0/artifacts/public/logs/live_backing.log
task 2025-04-17T01:11:09.597Z] 01:11:09 INFO - TEST-PASS | uriloader/exthandler/tests/unit/test_punycodeURIs.js | took 1173ms
[task 2025-04-17T01:11:09.606Z] 01:11:09 INFO - Retrying tests that failed when run in parallel.
[task 2025-04-17T01:11:09.612Z] 01:11:09 INFO - TEST-START | xpcshell-remote.toml:toolkit/components/extensions/test/xpcshell/test_ext_contentscript_order.js
[task 2025-04-17T01:11:10.621Z] 01:11:10 WARNING - TEST-UNEXPECTED-FAIL | xpcshell-remote.toml:toolkit/components/extensions/test/xpcshell/test_ext_contentscript_order.js | xpcshell return code: 0
[task 2025-04-17T01:11:10.633Z] 01:11:10 INFO - TEST-INFO took 1010ms
[task 2025-04-17T01:11:10.633Z] 01:11:10 INFO - >>>>>>>
[task 2025-04-17T01:11:10.634Z] 01:11:10 INFO - (xpcshell/head.js) | test MAIN run_test pending (1)
[task 2025-04-17T01:11:10.634Z] 01:11:10 INFO - (xpcshell/head.js) | test run_next_test 0 pending (2)
[task 2025-04-17T01:11:10.634Z] 01:11:10 INFO - (xpcshell/head.js) | test MAIN run_test finished (2)
[task 2025-04-17T01:11:10.634Z] 01:11:10 INFO - running event loop
[task 2025-04-17T01:11:10.634Z] 01:11:10 INFO - xpcshell-remote.toml:toolkit/components/extensions/test/xpcshell/test_ext_contentscript_order.js | Starting setup check_remote
[task 2025-04-17T01:11:10.635Z] 01:11:10 INFO - (xpcshell/head.js) | test check_remote pending (2)
| Comment hidden (Intermittent Failures Robot) |
| Comment hidden (Intermittent Failures Robot) |
| Comment hidden (Intermittent Failures Robot) |
| Assignee | ||
Comment 4•8 months ago
|
||
These failures started immediately after the test landed in bug 1792685.
I looked at recent failures, and the assertion failures (relevant parts pasted below) show that the style sheets are applied in an unexpected order:
TEST-UNEXPECTED-FAIL | xpcshell-remote.toml:toolkit/components/extensions/test/xpcshell/test_ext_contentscript_order.js | test_css_order - [test_css_order : undefined] start_2.css (not cached) applies before frame.onload - "1" == "2"
TEST-UNEXPECTED-FAIL | xpcshell-remote.toml:toolkit/components/extensions/test/xpcshell/test_ext_contentscript_order.js | test_css_order - [test_css_order : undefined] start_3.css (cached, blocked on start_2.css) applies before frame.onload - "2" == "3"
This shows something interesting:
- The first assertion failure implies that the
--css-start-12variable fromstart_1.csswas applied (value "1") instead of value "2" expected fromstart_2.css. - The second assertion failure implies that the
--css-start-23variable fromstart_2.csswas applied (value "2") instead of value "3" expected fromstart_3.css. - We expect the styles to apply in the order of
start_1.css,start_2.css,start_3.css. With just the first assertion error, one may think thatstart_2.cssdid not apply, but the second assertion shows that it did. Therefore the conclusion is that the styles fromstart_1.cssunexpectedly applied afterstart_2.css(instead of before).- The logs also suggest that
start_3.cssdid either not apply, or applied beforestart_2.css(instead of after). There is not enough information to tell which of the two is the case.
- The logs also suggest that
- I reproduced the issue locally, and with additional logging I can confirm that the scripts and styles are scheduled as expected. The issue is likely somewhere between
AddSheetand/orgetComputedStyle(...).getPropertyValue(...).
There are additional test failures (later) after the initial one, which show the same (incorrect) values.
TEST-UNEXPECTED-FAIL | xpcshell-remote.toml:toolkit/components/extensions/test/xpcshell/test_ext_contentscript_order.js | test_css_order - [test_css_order : 145] Got expected css order: --css-start-12 should be 2 - Expected: 2, Actual: 1 - false == true
TEST-UNEXPECTED-FAIL | xpcshell-remote.toml:toolkit/components/extensions/test/xpcshell/test_ext_contentscript_order.js | test_css_order - [test_css_order : 145] Got expected css order: --css-start-23 should be 3 - Expected: 3, Actual: 2 - false == true
| Assignee | ||
Comment 5•8 months ago
|
||
I can reproduce the issue locally, but only on a release build, not on a debug build.
When addSheet is used and mStyleSetFilled is true in Document::AddAdditionalStyleSheet, then the stylesheets are appended in the expected order.
When mStyleSetFilled is false, it is populated later via Document::FillStyleSet, in Document::FillStyleSetDocumentSheets. The AppendSheetsToStyleSet method appends the stylesheet in the reverse order. Consequently, the order of stylesheets is start_3.css, start_2.css, start_1.css instead of the expected start_1.css, start_2.css, start_3.css.
When I fix the order to be non-reversed, the failure goes away. I'll attach a patch.
Updated•8 months ago
|
| Assignee | ||
Comment 6•8 months ago
|
||
| Comment hidden (Intermittent Failures Robot) |
| Comment hidden (Intermittent Failures Robot) |
| Comment hidden (Intermittent Failures Robot) |
| Comment hidden (Intermittent Failures Robot) |
| Comment hidden (Intermittent Failures Robot) |
Description
•