Closed Bug 1628732 Opened 5 years ago Closed 4 years ago

Perma [tier2] browser/base/content/test/protectionsUI/browser_protectionsUI_cookies_subview.js | No contentBlockingEvent events should be received - Got 1, expected undefined

Categories

(Firefox :: Protections UI, defect, P5)

defect

Tracking

()

RESOLVED FIXED
Firefox 78

People

(Reporter: intermittent-bug-filer, Assigned: dimi)

References

(Regression)

Details

(Keywords: intermittent-failure, regression, Whiteboard: [retriggered])

Attachments

(2 files)

Filed by: csabou [at] mozilla.com
Parsed log: https://treeherder.mozilla.org/logviewer.html#?job_id=296967064&repo=mozilla-central
Full log: https://firefox-ci-tc.services.mozilla.com/api/queue/v1/task/e8BgDbplQGO_dvuFrixEdQ/runs/0/artifacts/public/logs/live_backing.log


[task 2020-04-09T13:50:29.187Z] 13:50:29 INFO - TEST-PASS | browser/base/content/test/protectionsUI/browser_protectionsUI_cookies_subview.js | Main view was shown -
[task 2020-04-09T13:50:29.188Z] 13:50:29 INFO - Console message: [JavaScript Warning: "Request to access cookie or storage on “https://test1.example.org/browser/browser/base/content/test/protectionsUI/cookieServer.sjs” was blocked because we are blocking all third-party storage access requests and content blocking is enabled."]
[task 2020-04-09T13:50:29.188Z] 13:50:29 INFO - Console message: [JavaScript Warning: "Request to access cookie or storage on “https://test1.example.org/browser/browser/base/content/test/protectionsUI/cookieServer.sjs” was blocked because we are blocking all third-party storage access requests and content blocking is enabled."]
[task 2020-04-09T13:50:29.188Z] 13:50:29 INFO - Buffered messages logged at 13:50:29
[task 2020-04-09T13:50:29.188Z] 13:50:29 INFO - Console message: [JavaScript Warning: "Request to access cookie or storage on “https://test1.example.org/browser/browser/base/content/test/protectionsUI/cookieServer.sjs” was blocked because we are blocking all third-party storage access requests and content blocking is enabled."]
[task 2020-04-09T13:50:29.188Z] 13:50:29 INFO - Console message: [JavaScript Error: "The character encoding of the plain text document was not declared. The document will render with garbled text in some browser configurations if the document contains characters from outside the US-ASCII range. The character encoding of the file needs to be declared in the transfer protocol or file needs to use a byte order mark as an encoding signature." {file: "https://test1.example.org/browser/browser/base/content/test/protectionsUI/cookieServer.sjs" line: 0}]
[task 2020-04-09T13:50:29.188Z] 13:50:29 INFO - Received onContentBlockingEvent event: 2147786880 (1 of 1)
[task 2020-04-09T13:50:29.188Z] 13:50:29 INFO - Buffered messages finished
[task 2020-04-09T13:50:29.188Z] 13:50:29 INFO - TEST-UNEXPECTED-FAIL | browser/base/content/test/protectionsUI/browser_protectionsUI_cookies_subview.js | No contentBlockingEvent events should be received - Got 1, expected undefined
[task 2020-04-09T13:50:29.188Z] 13:50:29 INFO - Stack trace:
[task 2020-04-09T13:50:29.188Z] 13:50:29 INFO - chrome://mochikit/content/browser-test.js:test_is:1320
[task 2020-04-09T13:50:29.188Z] 13:50:29 INFO - chrome://mochitests/content/browser/browser/base/content/test/protectionsUI/browser_protectionsUI_cookies_subview.js:assertSitesListed:160
[task 2020-04-09T13:50:29.188Z] 13:50:29 INFO - chrome://mochitests/content/browser/browser/base/content/test/protectionsUI/browser_protectionsUI_cookies_subview.js:testCookiesSubView:268
[task 2020-04-09T13:50:29.188Z] 13:50:29 INFO - chrome://mochikit/content/browser-test.js:Tester_execTest/<:1062
[task 2020-04-09T13:50:29.188Z] 13:50:29 INFO - chrome://mochikit/content/browser-test.js:Tester_execTest:1097
[task 2020-04-09T13:50:29.189Z] 13:50:29 INFO - chrome://mochikit/content/browser-test.js:nextTest/<:925
[task 2020-04-09T13:50:29.189Z] 13:50:29 INFO - chrome://mochikit/content/tests/SimpleTest/SimpleTest.js:SimpleTest.waitForFocus/waitForFocusInner/focusedOrLoaded/<:918
[task 2020-04-09T13:50:29.355Z] 13:50:29 INFO - TEST-PASS | browser/base/content/test/protectionsUI/browser_protectionsUI_cookies_subview.js | Cookies view was shown -

Dimi, Tim, we've been getting a bunch of Fission perma failure bugs filed for anti-tracking tests (also bug 1628501 and bug 1628514). I suspect this is related to your work, can you take a look? :)

Thanks!

Flags: needinfo?(tihuang)
Flags: needinfo?(dlee)

I'll check those bugs.

Assignee: nobody → dlee
Status: NEW → ASSIGNED
Flags: needinfo?(tihuang)
Flags: needinfo?(dlee)
Has Regression Range: --- → yes
Keywords: regression

I haven't figured out the root case.
This seems to only happen in windows opt build. This is quite strange based on what we've changed.
For some reason, in the windows build, it triggers additional anti-tracking checks and generates a content blocking event, which we don't expect receiving that in the test case[1].
Before Bug 1624552, this additional event was not notified because we couldn't get the top-level window, however, after Bug 1624552, getting the top-level window is no longer necessary, hence the event was notified.
I kind of feel that this is happening because we are doing the right thing now, but I am not sure, will keep investigate.

[1] https://searchfox.org/mozilla-central/rev/2cd2d511c0d94a34fb7fa3b746f54170ee759e35/browser/base/content/test/protectionsUI/browser_protectionsUI_cookies_subview.js#160

See Also: → 1628501

just an update that the additional request mentioned in Comment 6 is triggered by ImageCache code here with uri set to chrome://global/skin/icons/resizer.svg
I'll check what is the better solution for this (either fixed in testcase or in anti-tracking code).

Following tests are disabled

  • browser_protectionsUI_cookies_subview.js
  • browser_protectionsUI_state.js
  • browser_allowListNotifications.js
  • browser_urlDecorationStripping.js

The reason that this tests are failing in fission mode is because in
window64 opt mode, additional content blocking event is triggered when
loading chrome:://global/skin/icons/resizer.svg

We don't have this problem before because in this case, we couldn't get the
top-level window, so the event was not fired.
But the recent working to make anti-tracking fission compatible (Bug 1624552) removes
the need of getting top-level window, so the event is fired and
testcases don't expect that.

Obviously, this content blocking event is triggered when loading a chrome resource. Does it make sense to trigger blocking events for chrome resources? Maybe we can filter out this and not notify an event in this case.

Flags: needinfo?(dlee)

(In reply to Tim Huang[:timhuang] from comment #12)

Obviously, this content blocking event is triggered when loading a chrome resource. Does it make sense to trigger blocking events for chrome resources? Maybe we can filter out this and not notify an event in this case.

Yes, I think that is one of the possible solution we can do.
I have test this
https://treeherder.mozilla.org/#/jobs?repo=try&revision=4219f846d8d049e00baa0f3ca188af6e405138e3
2 out of the 4 testcases can be fixed by the way you suggested, and then I found out there are still 2 testcases needed to be fixed.
I haven't checked what the root cause for the other two, I'll check it and see what is the best solution.

Flags: needinfo?(dlee)
Keywords: leave-open
Pushed by dlee@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/65b2d0679b0f 1628501 - disable antitracking mochtiests that fail permanently on window64 opt r=timhuang
Pushed by dlee@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/479f86afa10a Don't notify block decision when uri is chrome r=timhuang,baku

no failure with the correct fix, close this bug

Status: ASSIGNED → RESOLVED
Closed: 4 years ago
Keywords: leave-open
Resolution: --- → FIXED
Target Milestone: --- → Firefox 78
See Also: → 1652329
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: