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

[wdspec] add network interception invalidation tests for all remaining methods #42667

Closed
wants to merge 6 commits into from

Conversation

thiagowfx
Copy link
Member

@thiagowfx thiagowfx commented Oct 20, 2023

  • fail request (previously added)
  • continue request
  • continue response
  • provide response
  • continue with auth

@thiagowfx
Copy link
Member Author

Note the TODOs:

# TODO: Add body.
# TODO: Add cookies.
# TODO: Add headers.

Because we are type-annotating everything, these will require extra work. Deferring them to another PR.

Base automatically changed from thiagowfx/fail-request to master October 23, 2023 09:04
@thiagowfx thiagowfx force-pushed the thiagowfx/continue-request branch 2 times, most recently from ad8f6fe to a884b62 Compare October 24, 2023 00:01
Copy link
Contributor

@juliandescottes juliandescottes left a comment

Choose a reason for hiding this comment

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

Looks good thanks! I need to take another look, but sharing some comments for now

webdriver/tests/bidi/network/continue_response/invalid.py Outdated Show resolved Hide resolved
webdriver/tests/bidi/network/continue_request/invalid.py Outdated Show resolved Hide resolved
webdriver/tests/bidi/network/continue_request/invalid.py Outdated Show resolved Hide resolved
webdriver/tests/bidi/network/continue_response/invalid.py Outdated Show resolved Hide resolved
tools/webdriver/webdriver/bidi/modules/network.py Outdated Show resolved Hide resolved
@thiagowfx thiagowfx changed the title test: add network interception continue request invalidation tests test: add network interception "continue request" and "continue response" invalidation tests Oct 24, 2023
@juliandescottes
Copy link
Contributor

Noticed another issue in continue_with_auth when adding "valid" tests locally. The credentials should be in a separate object. Instead they were at the top level of the command params. Re-flagging for review.

@thiagowfx
Copy link
Member Author

@sadym-chromium would you take this PR over?

@sadym-chromium
Copy link
Contributor

@sadym-chromium would you take this PR over?

yes, thanks!

on_response_completed = wait_for_event(RESPONSE_COMPLETED_EVENT)

text_url = url(PAGE_EMPTY_TEXT)
await fetch(text_url)

response_completed_event = await wait_for_future_safe(on_response_completed)
response_completed_event = await on_response_completed
Copy link
Contributor

Choose a reason for hiding this comment

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

Could this change maybe be the reason why the wpt.fyi results show a timeout for this test file now with Chrome?

Copy link
Contributor

Choose a reason for hiding this comment

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

No, the job seems to timeout on the invalid phase test.
The spec is quite clear about the fact that this should be an error:

If phase is "authRequired", then return error with error code invalid argument.

But even if they don't implement the phase check this shouldn't timeout.

Chrome also seems to timeout on various other tests:

  • continue_with_auth/invalid.py::test_params_request_invalid_phase[responseStarted]
  • continue_response/invalid.py::test_params_reason_phrase_invalid_type[False]

All those tests have in common that they need to block a request in another phase than "beforeRequest". I remember that during the initial review of this patch, I requested several times to change the phase of tests from "beforeRequest" to the appropriate phase but this was not addressed, so it's possible that chrome doesn't support blocking the request in phases after "beforeRequest".

Looking at wpt.fyi for other intercept test, my guess is that chrome is always adding intercepts in the beforeRequest phase, even if you are specifying another phase. This would be enough to make the setup_blocked_request helper timeout.

cc @sadym-chromium can you confirm or tell me where the code handling intercepts is located so that I can check?

Copy link
Contributor

Choose a reason for hiding this comment

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

Unfortunately, for now our network interception implementation is racy and sometimes hangs forever. We are working on fixing it.

Copy link
Contributor

Choose a reason for hiding this comment

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

Wait. This test does not set interceptions, so it should work just fine. Let me check.

Copy link
Contributor

Choose a reason for hiding this comment

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

Sorry it's a bit misleading :)

The question from @whimboo was added for this test (test_params_request_no_such_request), but the actual timeout happens in test_params_request_invalid_phase (right above this one) which indirectly uses add_intercept via setup_blocked_request

Copy link
Contributor

@whimboo whimboo left a comment

Choose a reason for hiding this comment

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

Thanks @juliandescottes. From my point of view this looks good now.

When merging it upstream we might have to wait for the next downstream sync. Maybe we can land on mozilla-central and then upstream sync, which is clearly faster?

@juliandescottes
Copy link
Contributor

Thanks @juliandescottes. From my point of view this looks good now.

When merging it upstream we might have to wait for the next downstream sync. Maybe we can land on mozilla-central and then upstream sync, which is clearly faster?

That would work for me. @sadym-chromium any objection or additional review feedback ?

@juliandescottes
Copy link
Contributor

Thanks for the review, pushed on phabricator at https://phabricator.services.mozilla.com/D196424 FYI.

moz-wptsync-bot pushed a commit that referenced this pull request Dec 15, 2023
…g methods

Synced from #42667

Differential Revision: https://phabricator.services.mozilla.com/D196424

bugzilla-url: https://bugzilla.mozilla.org/show_bug.cgi?id=1870032
gecko-commit: d3a29d02b3dd8d8cfbfff6fcad00d94226e102e8
gecko-reviewers: webdriver-reviewers, whimboo
@juliandescottes
Copy link
Contributor

This is now a duplicate of #43688 , closing.

moz-v2v-gh pushed a commit to mozilla/gecko-dev that referenced this pull request Dec 15, 2023
moz-wptsync-bot pushed a commit that referenced this pull request Dec 15, 2023
…g methods

Synced from #42667

Differential Revision: https://phabricator.services.mozilla.com/D196424

bugzilla-url: https://bugzilla.mozilla.org/show_bug.cgi?id=1870032
gecko-commit: d3a29d02b3dd8d8cfbfff6fcad00d94226e102e8
gecko-reviewers: webdriver-reviewers, whimboo
gecko-dev-updater pushed a commit to marco-c/gecko-dev-wordified-and-comments-removed that referenced this pull request Dec 16, 2023
…r all remaining methods r=webdriver-reviewers,whimboo

Synced from web-platform-tests/wpt#42667

Differential Revision: https://phabricator.services.mozilla.com/D196424

UltraBlame original commit: d3a29d02b3dd8d8cfbfff6fcad00d94226e102e8
gecko-dev-updater pushed a commit to marco-c/gecko-dev-wordified that referenced this pull request Dec 16, 2023
…r all remaining methods r=webdriver-reviewers,whimboo

Synced from web-platform-tests/wpt#42667

Differential Revision: https://phabricator.services.mozilla.com/D196424

UltraBlame original commit: d3a29d02b3dd8d8cfbfff6fcad00d94226e102e8
gecko-dev-updater pushed a commit to marco-c/gecko-dev-comments-removed that referenced this pull request Dec 16, 2023
…r all remaining methods r=webdriver-reviewers,whimboo

Synced from web-platform-tests/wpt#42667

Differential Revision: https://phabricator.services.mozilla.com/D196424

UltraBlame original commit: d3a29d02b3dd8d8cfbfff6fcad00d94226e102e8
aosmond pushed a commit to aosmond/gecko that referenced this pull request Dec 16, 2023
@thiagowfx thiagowfx deleted the thiagowfx/continue-request branch February 1, 2024 05:46
marcoscaceres pushed a commit that referenced this pull request Feb 23, 2024
…g methods

Synced from #42667

Differential Revision: https://phabricator.services.mozilla.com/D196424

bugzilla-url: https://bugzilla.mozilla.org/show_bug.cgi?id=1870032
gecko-commit: d3a29d02b3dd8d8cfbfff6fcad00d94226e102e8
gecko-reviewers: webdriver-reviewers, whimboo
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.

8 participants