Skip to content

Runtime type check webdriver.client #51816

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

Conversation

gsnedders
Copy link
Member

Having locally seen a request to POST /session/None/timeouts, clearly we aren't doing enough validation. This may well be indicative of bugs in the library, but we shouldn't be accidentally stringifying non-str types and sending them over the wire.

While we're at it, remove webdriver.client.Cookies because this has been dead since it was first added in 7033fdd and its __setitem__ is pretty broken (referring to a bogus WebDriver command, seemingly confusing name and value, and referring to some mysterious value.value), and adding a type check there just makes it more apparent how bogus it is.

This has been dead since it was first added in 7033fdd, and its
__setitem__ is pretty broken (referring to a bogus WebDriver command,
seemingly confusing name and value, and referring to some mysterious
value.value).
Having locally seen a request to POST `/session/None/timeouts`,
clearly we aren't doing enough validation. This may well be indicative
of bugs in the library, but we shouldn't be accidentally stringifying
non-str types and sending them over the wire.
Copy link
Member

@foolip foolip left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Changes look good, but are any of these errors hit in a full run?

@gsnedders
Copy link
Member Author

gsnedders commented Apr 3, 2025

Changes look good, but are any of these errors hit in a full run?

I haven't actually tried a full run; the times I've seen this are mostly cases where the browser has crashed in the middle of a wdspec test, where we're meant to create a new session for each command (which is also kinda suspect behaviour!) but then the relevant API doesn't. That should also be fixed, but it's a separate issue to this.

@gsnedders
Copy link
Member Author

@web-platform-tests/admins Can someone please force-merge this? See #51981, #51984, #51985. Having retriggered the runs three times now, I don't think we're going to get a clean run.

@jcscottiii jcscottiii merged commit ae40aef into web-platform-tests:master Apr 14, 2025
35 of 40 checks passed
@gsnedders gsnedders deleted the runtime-type-check-webdriver.client branch April 14, 2025 21:15
@darktears
Copy link
Contributor

darktears commented Apr 18, 2025

While trying to rollout a newer WPT into Chromium this PR showed regression into two tests:

  • webdriver/tests/classic/close_window/close.py
  • webdriver/tests/classic/delete_session/delete.py

The run is located here.
https://ci.chromium.org/ui/p/chromium/builders/try/linux-blink-rel/119506/overview

The failures are:

For close_window/close:

This is a wdspec test.
[ERROR] test_close_last_browsing_context
  teardown error: TypeError: Session.session_id must be a str to send a session command
Harness: the test ran to completion.

For delete_session/delete:

This is a wdspec test.
[ERROR] test_null_response_value
  teardown error: TypeError: Session.session_id must be a str to send a session command
[ERROR] test_accepted_beforeunload_prompt
  teardown error: TypeError: Session.session_id must be a str to send a session command
Harness: the test ran to completion.

I'm not familiar at all with the code and what it tries to do. Is it something wrong with the tests? The patch?

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

Successfully merging this pull request may close these issues.

6 participants