3 /mixed-content/gen/*/link-prefetch-tag.https.html tests are expected timeout
Categories
(Core :: DOM: Security, defect, P2)
Tracking
()
Tracking | Status | |
---|---|---|
firefox78 | --- | fixed |
People
(Reporter: jmaher, Assigned: jgraham)
References
Details
(Whiteboard: [domsecurity-active])
Attachments
(1 file)
I am looking into tests that are timeout and trying to get them fixed. I noticed that we have these 3 tests failing:
/mixed-content/gen/top.http-rp/opt-in/link-prefetch-tag.https.html
/mixed-content/gen/top.meta/opt-in/link-prefetch-tag.https.html
/mixed-content/gen/top.meta/unset/link-prefetch-tag.https.html
and they fail on the first test:
Mixed-Content: Expects allowed for link-prefetch-tag to same-https origin and keep-scheme redirection from https context.
I reproduced this locally on windows 10 and didn't see any additional information in the console.
Reporter | ||
Comment 1•4 years ago
|
||
:ckerschb, here are 3 tests that seem to be related, could you take a look at these or redirect to someone who can? There are many other tests in these directories, so I assume there is something specific in these tests that isn't supported or a pref we need, or an issue with the test itself.
Comment 2•4 years ago
|
||
We are doing a lot of refactoring in MCB right now, let me dig into what's going on here. Keeping my ni? until then.
Comment 3•4 years ago
|
||
I am clueless at this point. I only see 2 requests happening after the test is fired up:
-
https://web-platform.test:8443/common/security-features/subresource/xhr.py?key=22071c30-dfcf-4590-8eb2-8fa7f08ba4b4&path=%2Fmixed-content&action=put&value=f2c88372-c37f-434f-b16e-8cf3a6b30cc2 (which uses TYPE_INTERNAL_XMLHTTPREQUEST)
-
https://web-platform.test:8443/common/security-features/subresource/xhr.py?key=22071c30-dfcf-4590-8eb2-8fa7f08ba4b4&path=%2Fmixed-content&action=put&value=f2c88372-c37f-434f-b16e-8cf3a6b30cc2 (which uses TYPE_INTERNAL_XMLHTTPREQUEST)
There is nothing in the console and nothing related to the mixed content blocker.
The only thing I see is
- WARNING: NS_ENSURE_TRUE(mRequest) failed: file /home/ckerschb/source/mc/netwerk/base/nsBaseChannel.cpp, line 919
which links to here
I can't tell if that is related.
I'll keep digging.
Comment 4•4 years ago
|
||
James, have you encountered any harness issues related to link-prefetch-tag
that could potentially bring some insights to this problem here?
Assignee | ||
Comment 5•4 years ago
|
||
So, adding some logging in https://searchfox.org/mozilla-central/source/testing/web-platform/tests/common/security-features/resources/common.sub.js#207 I see handlers being added to the following objects with the given event name:
<link rel="prefetch" href="https://web-platform.tes…c3&path=%2Fmixed-content"> load
<link rel="prefetch" href="https://web-platform.tes…c3&path=%2Fmixed-content"> error
But I don't see resolve
or reject
are ever called. So I think that for some reason in the initial load we don't do the prefetch at all and so don't end up firing these events. Per the spec that seems to be allowed [1]. But it would be nice if we could find a way to make this test actually work (on reload it seems to pass).
Oh and while looking for someone to needinfo I discovered the network.prefetch-next.aggressive
pref, which seems to make this test pass.
[1] https://w3c.github.io/resource-hints/#load-and-error-events
Comment 6•4 years ago
|
||
I am slightly confused. Honza can you help me out understanding prefs. Last time we chatted we figured that the pref network.prefetch-next
is set to true here which should enable prefetch, right?
I have not seen where we can set network.prefetch-next.aggressive
as per comment 5. If that pref makes the test pass then I guess we can obviously flip it but I also wanted to understand what the difference is here.
Assignee | ||
Comment 7•4 years ago
|
||
This makes the tests which expect link rel=prefetch to always occur pass
Updated•4 years ago
|
Assignee | ||
Comment 8•4 years ago
|
||
Yeah, it's definitely also possible that the prefetch behaviour is a bug. I posted a patch with smaug as a reviewer since he seemed to have reviewed a lot of recent prefetch changes, but if Honza or someone wants to steal that's obviously OK.
Updated•4 years ago
|
Pushed by james@hoppipolla.co.uk: https://hg.mozilla.org/integration/autoland/rev/f405e817df72 Use agressive prefetch in mixed-content tests, r=smaug
Comment 10•4 years ago
|
||
bugherder |
Comment 11•4 years ago
|
||
Backed out for causing Bug 1630917 to permafail.
Failure log: https://treeherder.mozilla.org/logviewer.html#?job_id=302599240&repo=autoland
Backout: https://hg.mozilla.org/integration/autoland/rev/ccdac6a5a46cf1a4fa043d37414352503e3ab8dc
Comment 12•4 years ago
|
||
Backout merged: https://hg.mozilla.org/mozilla-central/rev/ccdac6a5a46c
Comment 13•4 years ago
|
||
Pushed by james@hoppipolla.co.uk: https://hg.mozilla.org/integration/autoland/rev/3f7932b4c557 Use agressive prefetch in mixed-content tests, r=smaug
Comment 14•4 years ago
|
||
network.prefetch-next.aggressive
described here:
// In usual case prefetch does not start until all normal loads are done.
// Aggressive mode ignores normal loads and just start prefetch ASAP.
// It's mainly for testing purpose and discoraged for normal use;
// see https://bugzilla.mozilla.org/show_bug.cgi?id=1281415 for details.
This comment could be related too: https://bugzilla.mozilla.org/show_bug.cgi?id=1281415#c3
To sum, the tests are simply doing something (an infinite load or some race condition) that will never allow a prefetch to start. Flipping this pref is a workaround. If that is also the right fix is a question to look at the tests more closely.
Assignee | ||
Comment 15•4 years ago
|
||
Note that aiui these tests are mostly checking security properties applied to all load types; they aren't specifically written to test prefetch semantics. So if the pref just means that the load happens, and doesn't change the interaction with mixed content blocking, I don't think it will adversely affect the correctness.
Comment 16•4 years ago
|
||
bugherder |
Description
•