WebKit Bugzilla
New
Browse
Log In
×
Sign in with GitHub
or
Remember my login
Create Account
·
Forgot Password
Forgotten password account recovery
NEW
127676
WebKit tests should run with access to multiple hostnames that all resolve to the test web server
https://bugs.webkit.org/show_bug.cgi?id=127676
Summary
WebKit tests should run with access to multiple hostnames that all resolve to...
youenn fablet
Reported
2014-01-27 01:40:13 PST
Some W3C tests make request on dynamically computed URLs such as "
http://www2
."+location.host. See for instance
https://github.com/w3c/web-platform-tests/blob/master/XMLHttpRequest/send-redirect-to-cors.htm
This breaks the underlying test framework. First, "www2." + location.host cannot be referenced without changing /etc/hosts. Mapping should be set to 127.0.0.1 Second, "www2." + location.host will not be authorized by DumpRenderTrees as it is neither "localhost" nor 127.0.0.1
Attachments
WIP: Enable all *.localhost URLS
(3.07 KB, patch)
2014-06-19 08:11 PDT
,
youenn fablet
no flags
Details
Formatted Diff
Diff
Show Obsolete
(1)
View All
Add attachment
proposed patch, testcase, etc.
youenn fablet
Comment 1
2014-01-27 01:47:22 PST
> First, "www2." + location.host cannot be referenced without changing /etc/hosts. Mapping should be set to 127.0.0.1
The simplest approach would be to require proper setting of /etc/hosts, for instance by adding entries for "www.web-platform.test", "www2.web-platform.test"...
> Second, "www2." + location.host will not be authorized by DumpRenderTree as it is neither "localhost" nor 127.0.0.1
One solution is to authorize URLS with specific prefixes (.test or .local e.g.) Another solution is to check that the host resolves to 127.0.0.1.
youenn fablet
Comment 2
2014-06-19 08:11:59 PDT
Created
attachment 233362
[details]
WIP: Enable all *.localhost URLS
Alexey Proskuryakov
Comment 3
2016-01-12 10:35:45 PST
I don't think that we should be doing this. If I were a new contributor to submit my first patch, I'd certainly refuse to work on a project that insists on modifying my /etc/hosts, or on making any other persistent changes on my machine.
youenn fablet
Comment 4
2016-01-12 12:31:41 PST
(In reply to
comment #3
)
> I don't think that we should be doing this. > > If I were a new contributor to submit my first patch, I'd certainly refuse > to work on a project that insists on modifying my /etc/hosts, or on making > any other persistent changes on my machine.
This is how it is suggested to be done in
https://github.com/w3c/web-platform-tests
. Bots can be made to work for these tests quite easily, but that does not help contributors much. Do you see any other practical alternative? I am not sure a proxy would be the right solution here. I do not know exactly how much tests require these URLs. The XHR tests are covered by other WebKit tests so this is probably ok for these tests. It would be nice though to have a bot dedicated to WPT conformance, trying to pass all tests and doing reports. At least we would know whether these tests (and other WPT) are passing or not.
Alexey Proskuryakov
Comment 5
2016-01-12 13:15:46 PST
In WebKit tests, we've been using the distinction between 127.0.0.1 and localhost, as well as http/https and multiple ports. Perhaps W3C tests could be changed to not require local setup? That seems like it would be a win for everyone.
> It would be nice though to have a bot dedicated to WPT conformance
That's a good idea. Do you know if there is anyone who would track the progress, and/or actively work on increasing the pass rate?
youenn fablet
Comment 6
2016-01-12 14:22:36 PST
(In reply to
comment #5
)
> In WebKit tests, we've been using the distinction between 127.0.0.1 and > localhost, as well as http/https and multiple ports. Perhaps W3C tests could > be changed to not require local setup? That seems like it would be a win for > everyone.
That is probably not straightforward as WPT tests are made to work both locally as well as from w3c-tests.org.
> > It would be nice though to have a bot dedicated to WPT conformance > > That's a good idea. Do you know if there is anyone who would track the > progress, and/or actively work on increasing the pass rate?
I am interested in that. cdumez did some work to improve the pass rate, for instance on the binding generator. I do not know the context of this activity though.
youenn fablet
Comment 7
2016-01-15 08:55:01 PST
> I do not know exactly how much tests require these URLs.
27 -expected.txt files exhibit a "Blocked access message". There may be other tests not running properly due to these limitations though.
Chris Dumez
Comment 8
2017-01-20 10:04:41 PST
(In reply to
comment #3
)
> I don't think that we should be doing this. > > If I were a new contributor to submit my first patch, I'd certainly refuse > to work on a project that insists on modifying my /etc/hosts, or on making > any other persistent changes on my machine.
Well, you don't have to as a developer but then you would have some tests failing locally. The fact is that - at the moment - anyone working on web-platform-tests has to modify their hosts file. Sure, it'd be nice if we could work with upstream to try and get them to adopt a configuration that is more convenient for us. We can certainly try this route but I have my doubts it will be successful. I have also been told that out configuration is insufficient to cover all cases the tests are actually covering. If we cannot get upstream tests to change then I think we need to deal with this downstream somehow. Right now, the solution is to skip to tests or have their baseline claiming the test fails even though it would pass if the machine was properly configured. I think we have to do better than this. I personally think having a script called "prepare-machine-for-development" or so (which would add the right entries to /etc/hosts for you) would be a better solution than what we have right now.
youenn fablet
Comment 9
2017-01-20 10:10:13 PST
> Sure, it'd be nice if we could work with upstream to try and get them to > adopt a configuration that is more convenient for us. We can certainly try > this route but I have my doubts it will be successful. I have also been told > that out configuration is insufficient to cover all cases the tests are > actually covering.
Right, some tests require different hostnames, not just different ports. Some other tests require subdomain relationships (www.localhost/localhost for instance).
Darin Adler
Comment 10
2017-01-20 15:21:38 PST
I think should add a feature at a low level of WebKit itself that can let us test in this fashion with development builds. It can be something that the test runners turn on and something that we can turn on with some kind of debugging menu. There must be a relatively small number of bottlenecks for URL and host name processing that we could hook into. I agree that we don’t want to make test running require changing the configuration of the computer unless it is absolutely necessary and I don’t think it is.
Alexey Proskuryakov
Comment 11
2017-02-12 23:32:15 PST
***
Bug 168220
has been marked as a duplicate of this bug. ***
Alexey Proskuryakov
Comment 12
2017-02-12 23:45:45 PST
Simon found another related quirk - in Chrome, subdomains of localhost all resolve to 127.0.0.1. This seems to have started with some weird requirements in <
https://tools.ietf.org/html/rfc6761#section-6.3
>. Chrome chose to follow this RFC, but no one else appears convinced. Some history in <
https://bugs.chromium.org/p/chromium/issues/detail?id=489973
> and <
https://tools.ietf.org/html/draft-west-let-localhost-be-localhost
>.
Sam Sneddon [:gsnedders]
Comment 13
2020-11-16 11:10:07 PST
See also:
https://github.com/web-platform-tests/wpt/issues/3243
https://github.com/web-platform-tests/wpt/pull/3302
https://github.com/web-platform-tests/wpt/issues/15692
Radar WebKit Bug Importer
Comment 14
2020-11-16 11:10:18 PST
<
rdar://problem/71449599
>
Frédéric Wang (:fredw)
Comment 15
2020-11-20 03:06:20 PST
I'm making this block
bug 171934
; localhost and loopback IP addresses are considered non-mixed content so being able to access other addresses for testing purpose would be useful (otherwise we need to disable the preferences when running tests). This is also causing
bug 218795
.
Frédéric Wang (:fredw)
Comment 16
2020-11-20 03:08:36 PST
(and incidentally supporting .localhost as done in attachment
bug 233362
and the ipv6 loopback ip address as suggested in the FIXME would help for testing
bug 218627
and
bug 218623
)
Sam Sneddon [:gsnedders]
Comment 17
2021-07-05 14:18:28 PDT
(In reply to Darin Adler from
comment #10
)
> I think should add a feature at a low level of WebKit itself that can let us > test in this fashion with development builds. It can be something that the > test runners turn on and something that we can turn on with some kind of > debugging menu. There must be a relatively small number of bottlenecks for > URL and host name processing that we could hook into. > > I agree that we don’t want to make test running require changing the > configuration of the computer unless it is absolutely necessary and I don’t > think it is.
Note that Chrome and Firefox both have such functionality in their shipping browsers, which matters if we want to be able to run WPT tests against Safari without changing the system configuration (which is, of course, impossible on iOS on device). This does also mean that Safari is the only browser that actually requires /etc/hosts to be modified to run the tests through wptrunner. At least currently, WebKit doesn't have any way to intercept the DNS request within the network stack, and I don't know how easy that is for the different network stacks currently supported. Moving away from localhost/loopback addresses is almost certainly needed to match the expected behaviour in some tests, given localhost is special-cased in some places in the web platform. Also, there's also nonexistent.[wpt domain] that's meant to fail to resolve, which we probably need to deal with too. (I know some Gecko developers had issues with some ISPs where the DNS provider intercepted any failure to redirect to a search page, hence it _wasn't_ failing to resolve.)
Michael Catanzaro
Comment 18
2021-09-27 13:59:47 PDT
(In reply to Sam Sneddon [:gsnedders] from
comment #17
)
> At least currently, WebKit doesn't have any way to intercept the DNS request > within the network stack, and I don't know how easy that is for the > different network stacks currently supported.
FYI, for the libsoup backend it is quite easy. We just write a new GResolver, have it wrap the default system GResolver, and handle our special hostnames differently. It would need a WebKit internal API to enable use of the test GResolver.
youenn fablet
Comment 19
2022-02-02 02:34:06 PST
(In reply to Michael Catanzaro from
comment #18
)
> (In reply to Sam Sneddon [:gsnedders] from
comment #17
) > > At least currently, WebKit doesn't have any way to intercept the DNS request > > within the network stack, and I don't know how easy that is for the > > different network stacks currently supported. > > FYI, for the libsoup backend it is quite easy. We just write a new > GResolver, have it wrap the default system GResolver, and handle our special > hostnames differently. It would need a WebKit internal API to enable use of > the test GResolver.
It would be an interesting experiment to add the necessary logic in WebKit to make use of that GResolver. We might need something like: - Add an internal feature to toggle this on/off - Update test runner source code to allow non localhost/127.0.0.1 hosts. Is there any GTK folk interested in that? I'll be happy to help.
Frédéric Wang (:fredw)
Comment 20
2022-02-02 02:39:34 PST
Not sure that can help, but FWIW I had experimented non-loopback address for cocoa API tests on
https://bugs.webkit.org/show_bug.cgi?id=235083
; the patch seemed to work locally on my mac but not on EWS.
Patrick Griffis
Comment 21
2022-07-16 11:04:51 PDT
Initial work on this done here:
https://github.com/WebKit/WebKit/pull/2489
Note
You need to
log in
before you can comment on or make changes to this bug.
Top of Page
Format For Printing
XML
Clone This Bug