Bug 220096

Summary: Remove non-inclusive language from tests in http/tests/xmlhttprequest
Product: WebKit Reporter: Beth Dakin <bdakin>
Component: Tools / TestsAssignee: Nobody <webkit-unassigned>
Status: RESOLVED FIXED    
Severity: Normal CC: achristensen, ap, bdakin, beidson, ggaren, rniwa, sam, webkit-bug-importer
Priority: P2 Keywords: InRadar
Version: WebKit Local Build   
Hardware: Unspecified   
OS: Unspecified   
Bug Depends on:    
Bug Blocks: 213092    
Attachments:
Description Flags
Patch ap: review+, ews-feeder: commit-queue-

Description Beth Dakin 2020-12-22 11:37:51 PST
See results of 'report-non-inclusive-language --verbose' inside http/tests/xmlhttprequest below. I tried re-naming everything, but the tests broke (failure diff below), and I don't understand these tests enough to take the investigation much further. 

Script output:
access-control-basic-allow-list-request-headers.html: whitelist: 1
access-control-basic-allow-list-response-headers.html: whitelist: 1
resources/access-control-basic-whitelist-response-headers.cgi: whitelist: 2
Total: 4 (blacklist: 0, whitelist: 4, slave: 0)


Failure from simple re-name:
--- /Volumes/Data/worker/macOS-Mojave-Debug-WK1-Tests-EWS/build/layout-test-results/http/tests/xmlhttprequest/access-control-basic-allow-list-request-headers-expected.txt
+++ /Volumes/Data/worker/macOS-Mojave-Debug-WK1-Tests-EWS/build/layout-test-results/http/tests/xmlhttprequest/access-control-basic-allow-list-request-headers-actual.txt
@@ -1,6 +1,4 @@
-Accept: *
-Accept-Language: ru
-Content-Language: ru
-Content-Type: text/plain
+CONSOLE MESSAGE: Origin http://127.0.0.1:8000 is not allowed by Access-Control-Allow-Origin.
+CONSOLE MESSAGE: XMLHttpRequest cannot load http://localhost:8000/xmlhttprequest/resources/access-control-basic-allowlist-request-headers.cgi due to access control checks.
+Unexpected exception: NetworkError:  A network error occurred.
 
-


--- /Volumes/Data/worker/macOS-Mojave-Debug-WK1-Tests-EWS/build/layout-test-results/http/tests/xmlhttprequest/access-control-basic-allow-list-response-headers-expected.txt
+++ /Volumes/Data/worker/macOS-Mojave-Debug-WK1-Tests-EWS/build/layout-test-results/http/tests/xmlhttprequest/access-control-basic-allow-list-response-headers-actual.txt
@@ -1,9 +1,4 @@
-PASS: Response header cache-control allowed.
-PASS: Response header content-language allowed.
-PASS: Response header content-type allowed.
-PASS: Response header expires allowed.
-PASS: Response header last-modified allowed.
-PASS: Response header pragma allowed.
-PASS: Response header x-webkit denied.
-PASS: Non-allowlisted headers not passed to getAllResponseHeaders().
+CONSOLE MESSAGE: Origin http://127.0.0.1:8000 is not allowed by Access-Control-Allow-Origin.
+CONSOLE MESSAGE: XMLHttpRequest cannot load http://localhost:8000/xmlhttprequest/resources/access-control-basic-allowlist-response-headers.cgi due to access control checks.
+CONSOLE MESSAGE: NetworkError:  A network error occurred.
Comment 1 Alexey Proskuryakov 2020-12-22 13:12:25 PST
I don't remember anything anything tricky about these. Presumably you renamed the cgi files, not just changed the requests?
Comment 2 Beth Dakin 2020-12-22 13:14:29 PST
(In reply to Alexey Proskuryakov from comment #1)
> I don't remember anything anything tricky about these. Presumably you
> renamed the cgi files, not just changed the requests?

Yes, I did. I can try again and upload a patch here to try on the bots.
Comment 3 Beth Dakin 2020-12-22 13:40:48 PST
Created attachment 416689 [details]
Patch

Okay well now these tests do show as passing with these changes on my machine, so maybe I did something silly before.
Comment 4 Beth Dakin 2020-12-22 15:07:33 PST
Okay, now the tests are failing in the same way they were before. What do you think?
Comment 5 Alexey Proskuryakov 2020-12-22 15:32:59 PST
Comment on attachment 416689 [details]
Patch

I see the problem - cgi files need to have the Unix executable bit set, and they do not when testing the patch in EWS.

Applying the patch locally to an svn checkout with svn-apply, I see the executable bit preserved on rename, so it must be a webkit-patch limitation when dealing with git-svn.

Please land this manually from a pure svn checkout, or I can land it for you.
Comment 6 Alexey Proskuryakov 2020-12-22 15:35:24 PST
The way I found the problem was by downloading the full archive (via the "download layout test results" link in Buildbot), and checking Apache's error_log.txt file:

[Tue Dec 22 14:05:19.565341 2020] [cgi:error] [pid 1426] [client ::1:49939] AH01215: (13)Permission denied: exec of '/Volumes/Data/worker/macOS-Mojave-Release-WK1-Tests-EWS/build/LayoutTests/http/tests/xmlhttprequest/resources/access-control-basic-allowlist-request-headers.cgi' failed: /Volumes/Data/worker/macOS-Mojave-Release-WK1-Tests-EWS/build/LayoutTests/http/tests/xmlhttprequest/resources/access-control-basic-allowlist-request-headers.cgi, referer: http://127.0.0.1:8000/xmlhttprequest/access-control-basic-allow-list-request-headers.html
Comment 7 Alexey Proskuryakov 2020-12-22 15:58:23 PST
Committed http://trac.webkit.org/r271067
Comment 8 Radar WebKit Bug Importer 2020-12-22 15:59:29 PST
<rdar://problem/72603935>