Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Variant tests with parens and pipes in URL fail to run on Safari #17027

Closed
foolip opened this issue May 27, 2019 · 14 comments
Closed

Variant tests with parens and pipes in URL fail to run on Safari #17027

foolip opened this issue May 27, 2019 · 14 comments

Comments

@foolip
Copy link
Member

foolip commented May 27, 2019

https://wpt.fyi/results/html/dom?run_id=264030002&run_id=248260003&run_id=262080001&run_id=234440001 has the four variants of Safari on macOS that we currently run: stable + preview on Azure Pipelines and Buildbot.

All of them fail /html/dom/interfaces.https.html?exclude=(Document|Window|HTML.*) and /html/dom/interfaces.https.html?include=(Document|Window) like this:

ERROR message: Could not parse requested URL 'https://web-platform.test:8443/html/dom/interfaces.https.html?include=(Document|Window)'
Traceback (most recent call last):
  File "/Users/kazooie/worker/macOS_Chunked_Runner/build/tools/wptrunner/wptrunner/executors/executorwebdriver.py", line 282, in _run
    self.result = True, self.func(self.protocol, self.url, self.timeout)
  File "/Users/kazooie/worker/macOS_Chunked_Runner/build/tools/wptrunner/wptrunner/executors/executorwebdriver.py", line 351, in do_testharness
    protocol.webdriver.url = url
  File "/Users/kazooie/worker/macOS_Chunked_Runner/build/tools/webdriver/webdriver/client.py", line 20, in inner
    return func(self, *args, **kwargs)
  File "/Users/kazooie/worker/macOS_Chunked_Runner/build/tools/webdriver/webdriver/client.py", line 521, in url
    return self.send_session_command("POST", "url", body)
  File "/Users/kazooie/worker/macOS_Chunked_Runner/build/tools/webdriver/webdriver/client.py", line 508, in send_session_command
    return self.send_command(method, url, body)
  File "/Users/kazooie/worker/macOS_Chunked_Runner/build/tools/webdriver/webdriver/client.py", line 472, in send_command
    raise err
InvalidArgumentException: invalid argument (400): Could not parse requested URL 'https://web-platform.test:8443/html/dom/interfaces.https.html?include=(Document|Window)'

Python on macOS doesn't like https://web-platform.test:8443/html/dom/interfaces.https.html?include=(Document|Window), and I suspect it's because of the parenthesis or pipe characters.

@zcorpan do you know where this pipe character is put into the manifest? I'd like to try escaping it as %7C to see if that fixes the problem.

@gsnedders
Copy link
Member

That's not Python on macOS not liking that, it's the WebDriver server (in this case in SafariDriver) responding with 400 Bad Request. @burg? I presume it's something like using a URL parser that treats the pipe character as invalid (which it is per RFC3986, for example).

@zcorpan
Copy link
Member

zcorpan commented May 27, 2019

From what I understand of https://url.spec.whatwg.org/#query-state the pipe character is a validation error but does not return failure (i.e., it should parse successfully).

So I think there are multiple ways to address this problem, not mutually exclusive:

  • Fix SafariDriver's URL parser
  • URL-encode the URL so that invalid characters are URL-escaped before entering the manifest
  • Change tests to have valid URL strings in <meta name=variant content=...>
  • Previous point + lint checker

@gsnedders gsnedders changed the title Variant tests with parens and pipes in URL fail to run on macOS Variant tests with parens and pipes in URL fail to run on Safari Jun 3, 2019
@gsnedders
Copy link
Member

If I'm reading the URL spec correctly, there's no valid URL equivalent to https://web-platform.test:8443/html/dom/interfaces.https.html?include=(Document|Window) (escaping it doesn't provide an equivalent URL, which is part of whatwg/url#369).

@foolip
Copy link
Member Author

foolip commented Jun 4, 2019

@gsnedders in this instance does it matter if the URL is considered equivalent, as long as the code that parses include=(Document|Window) (where?) handles the URL correctly?

Regardless, if the bug is in SafariDriver and it only affects a few tests, leaving this blocked on a SafariDriver fix might be reasonable. @burg can you file a bug, or should one be filed through https://feedbackassistant.apple.com/?

@burg
Copy link
Contributor

burg commented Jun 5, 2019 via email

@foolip
Copy link
Member Author

foolip commented Nov 19, 2019

https://wpt.fyi/results/html/dom?run_id=352740001&run_id=376000001 shows that this works in WebKitGTK but not Safari.

@clopez could you look into this and file an issue for safaridriver, or for WebKit if you can spot the problem there?

@gsnedders
Copy link
Member

IIRC, @burg filed a Radar issue for this.

@burg
Copy link
Contributor

burg commented Nov 19, 2019 via email

@foolip
Copy link
Member Author

foolip commented Nov 19, 2019

Alright, great! Is there a public ID for it in case I want to reference it?

@burg
Copy link
Contributor

burg commented Nov 19, 2019 via email

@burg
Copy link
Contributor

burg commented Apr 8, 2020

Sorry about the crazy wait on this one. If all goes well, the fix should be out with Safari Technology Preview 106.

@foolip
Copy link
Member Author

foolip commented Apr 9, 2020

Sweet, thanks for fixing this, Brian!

@foolip
Copy link
Member Author

foolip commented Apr 30, 2020

It looks like this was already fixed in STP 105:
https://wpt.fyi/results/html/dom?run_id=510170002&run_id=503710001

Yay!

@foolip foolip closed this as completed Apr 30, 2020
@burg
Copy link
Contributor

burg commented Apr 30, 2020 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants