Bug 212978

Summary: Use nonexistent.127.0.0.1 instead of nonexistent.localhost in our copy of wpt xhr tests
Product: WebKit Reporter: Alex Christensen <achristensen>
Component: New BugsAssignee: Alex Christensen <achristensen>
Status: RESOLVED WONTFIX    
Severity: Normal CC: ap, clopez, darin, ews-watchlist, youennf
Priority: P2    
Version: WebKit Nightly Build   
Hardware: Unspecified   
OS: Unspecified   
Attachments:
Description Flags
Patch ap: review-

Description Alex Christensen 2020-06-09 11:04:39 PDT
Use nonexistent.127.0.0.1 instead of nonexistent.localhost in our copy of wpt xhr tests
Comment 1 Alex Christensen 2020-06-09 11:07:18 PDT
Created attachment 401453 [details]
Patch
Comment 2 EWS Watchlist 2020-06-09 11:07:55 PDT
This patch modifies the imported WPT tests. Please ensure that any changes on the tests (not coming from a WPT import) are exported to WPT. Please see https://trac.webkit.org/wiki/WPTExportProcess
Comment 3 Darin Adler 2020-06-09 11:56:10 PDT
Comment on attachment 401453 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=401453&action=review

> LayoutTests/imported/w3c/ChangeLog:3
> +        Use nonexistent.127.0.0.1 instead of nonexistent.localhost in our copy of wpt xhr tests

Why the "127.0.0.1" bit? This is not being treated as an IP address, so it seems that "nonexistent.0" would also work just as well, no?
Comment 4 Alex Christensen 2020-06-09 11:57:17 PDT
It would, but this makes it closer to what exists in the upstream repo, and easier to see the intent of this fake host.
Comment 5 Alexey Proskuryakov 2020-06-09 11:57:46 PDT
Comment on attachment 401453 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=401453&action=review

> LayoutTests/imported/w3c/ChangeLog:10
> +        We have some bots where a connection to nonexistent.localhost times out instead of fails.
> +        To cover this up, use a domain that will actually fail.

The tests still won't work as designed, because nonexistent.127.0.0.1 doesn't resolve to loopback on macOS.

I think that WPT tests are written with this expired draft in mind <https://tools.ietf.org/html/draft-west-let-localhost-be-localhost>, and work on platforms where localhost subdomains resolve to loopback. This patch will break that, because nonexistent.127.0.0.1 isn't supposed to work this way.
Comment 6 Alexey Proskuryakov 2020-06-09 11:59:32 PDT
I think that skipping these tests would be OK, even though they found something semi-relevant for us in <rdar://problem/63684261>.
Comment 7 Alex Christensen 2020-06-09 12:00:55 PDT
The intent of these tests is to check what happens when an XHR fails.  This keeps that.  Skipping these tests would just reduce test coverage.
Comment 8 Alexey Proskuryakov 2020-06-09 13:04:52 PDT
But the intent is certainly not that they are blocked as "external URL" by our script machinery.