Closed Bug 1870816 Opened 1 year ago Closed 1 year ago

Perma late beta webdriver/tests/bidi/network/continue_with_auth/action.py | test_provideCredentials - AssertionError when Gecko 122 merges to Late Beta on 2024-01-05

Categories

(Remote Protocol :: WebDriver BiDi, defect, P1)

defect
Points:
2

Tracking

(firefox-esr115 unaffected, firefox121 unaffected, firefox122+ fixed, firefox123+ fixed)

RESOLVED FIXED
123 Branch
Tracking Status
firefox-esr115 --- unaffected
firefox121 --- unaffected
firefox122 + fixed
firefox123 + fixed

People

(Reporter: noemi_erli, Assigned: jdescottes)

References

(Regression)

Details

(Keywords: regression, Whiteboard: [webdriver:m9])

Attachments

(1 file)

Central-as-beta simulation:
How to run these simulations:
Failure log

[task 2023-12-19T12:15:18.728Z] 12:15:18     INFO - TEST-PASS | /webdriver/tests/bidi/network/continue_with_auth/action.py | test_default 
[task 2023-12-19T12:15:18.729Z] 12:15:18     INFO - TEST-UNEXPECTED-FAIL | /webdriver/tests/bidi/network/continue_with_auth/action.py | test_provideCredentials - AssertionError
[task 2023-12-19T12:15:18.729Z] 12:15:18     INFO - setup_blocked_request = <function setup_blocked_request.<locals>.setup_blocked_request at 0x7f83f77ac310>
[task 2023-12-19T12:15:18.730Z] 12:15:18     INFO - subscribe_events = <function subscribe_events.<locals>.subscribe_events at 0x7f83f77acb80>
[task 2023-12-19T12:15:18.730Z] 12:15:18     INFO - bidi_session = <webdriver.bidi.client.BidiSession object at 0x7f83f77d7130>
[task 2023-12-19T12:15:18.730Z] 12:15:18     INFO - url = <function url.<locals>.url at 0x7f83f77ac040>
[task 2023-12-19T12:15:18.731Z] 12:15:18     INFO - 
[task 2023-12-19T12:15:18.731Z] 12:15:18     INFO -     async def test_provideCredentials(
[task 2023-12-19T12:15:18.731Z] 12:15:18     INFO -         setup_blocked_request, subscribe_events, bidi_session, url
[task 2023-12-19T12:15:18.731Z] 12:15:18     INFO -     ):
[task 2023-12-19T12:15:18.731Z] 12:15:18     INFO -         # Setup unique username / password because browsers cache credentials.
[task 2023-12-19T12:15:18.732Z] 12:15:18     INFO -         username = "test_provideCredentials"
[task 2023-12-19T12:15:18.732Z] 12:15:18     INFO -         password = "test_provideCredentials_password"
[task 2023-12-19T12:15:18.732Z] 12:15:18     INFO -         request = await setup_blocked_request("authRequired", username=username, password=password)
[task 2023-12-19T12:15:18.732Z] 12:15:18     INFO -     
[task 2023-12-19T12:15:18.732Z] 12:15:18     INFO -         # Additionally subscribe to network.responseCompleted
[task 2023-12-19T12:15:18.732Z] 12:15:18     INFO -         await subscribe_events(events=[RESPONSE_COMPLETED_EVENT])
[task 2023-12-19T12:15:18.732Z] 12:15:18     INFO -     
[task 2023-12-19T12:15:18.732Z] 12:15:18     INFO -         # Track all received network.responseCompleted events in the events array
[task 2023-12-19T12:15:18.732Z] 12:15:18     INFO -         events = []
[task 2023-12-19T12:15:18.732Z] 12:15:18     INFO -     
[task 2023-12-19T12:15:18.732Z] 12:15:18     INFO -         async def on_event(method, data):
[task 2023-12-19T12:15:18.732Z] 12:15:18     INFO -             events.append(data)
[task 2023-12-19T12:15:18.732Z] 12:15:18     INFO -     
[task 2023-12-19T12:15:18.733Z] 12:15:18     INFO -         remove_listener = bidi_session.add_event_listener(
[task 2023-12-19T12:15:18.733Z] 12:15:18     INFO -             RESPONSE_COMPLETED_EVENT, on_event
[task 2023-12-19T12:15:18.733Z] 12:15:18     INFO -         )
[task 2023-12-19T12:15:18.733Z] 12:15:18     INFO -     
[task 2023-12-19T12:15:18.733Z] 12:15:18     INFO -         credentials = AuthCredentials(username=username, password=password)
[task 2023-12-19T12:15:18.733Z] 12:15:18     INFO -         await bidi_session.network.continue_with_auth(
[task 2023-12-19T12:15:18.733Z] 12:15:18     INFO -             request=request, action="provideCredentials", credentials=credentials
[task 2023-12-19T12:15:18.733Z] 12:15:18     INFO -         )
[task 2023-12-19T12:15:18.733Z] 12:15:18     INFO -     
[task 2023-12-19T12:15:18.734Z] 12:15:18     INFO -         wait = AsyncPoll(bidi_session, message="Didn't receive response completed events")
[task 2023-12-19T12:15:18.734Z] 12:15:18     INFO -         await wait.until(lambda _: len(events) >= 2)
[task 2023-12-19T12:15:18.734Z] 12:15:18     INFO -         assert len(events) == 2
[task 2023-12-19T12:15:18.734Z] 12:15:18     INFO -     
[task 2023-12-19T12:15:18.734Z] 12:15:18     INFO - >       assert_response_event(
[task 2023-12-19T12:15:18.734Z] 12:15:18     INFO -             events[0],
[task 2023-12-19T12:15:18.734Z] 12:15:18     INFO -             expected_response={
[task 2023-12-19T12:15:18.734Z] 12:15:18     INFO -                 "status": 401,
[task 2023-12-19T12:15:18.734Z] 12:15:18     INFO -                 "statusText": "Unauthorized",
[task 2023-12-19T12:15:18.734Z] 12:15:18     INFO -             },
[task 2023-12-19T12:15:18.734Z] 12:15:18     INFO -         )
[task 2023-12-19T12:15:18.735Z] 12:15:18     INFO - 

Julian, could you please take a look at this?
Thanks.

Flags: needinfo?(jdescottes)

This might be related to network.auth.use_redirect_for_retries which is only true for early beta or earlier: https://searchfox.org/mozilla-central/source/modules/libpref/init/StaticPrefList.yaml#11333-11337

Summary: Perma late beta webdriver/tests/bidi/network/continue_with_auth/action.py | test_provideCredentials - AssertionError when Gecko 123 merges to Beta on 2024-01-22 → Perma late beta webdriver/tests/bidi/network/continue_with_auth/action.py | test_provideCredentials - AssertionError when Gecko 122 merges to Late Beta on 2024-01-05

I confirm this comes from the pref mentioned above. We always get the expected number of "network.responseCompleted" events, but the status differs depending on the preference.

With the pref enabled the failed attempts have a 401 status, and only the final one has a 200 status code. With the pref disabled, all responseCompleted events have a 200 status.

This reminds me that the spec actually expects a single responseCompleted event, which might have to change in the future (see https://bugzilla.mozilla.org/show_bug.cgi?id=1826196#c2)

So I think for now I should relax the test to only wait until we get at least 1 responseCompleted event with status OK, and stop asserting the number of events and the status of previous responseCompleted events.

Assignee: nobody → jdescottes
Status: NEW → ASSIGNED
Flags: needinfo?(jdescottes)

Set release status flags based on info from the regressing bug 1826196

Comment on attachment 9369426 [details]
Bug 1870816 - [wdspec] Do not assert each responseCompleted event in continue with auth tests

Beta/Release Uplift Approval Request

  • User impact if declined: Fixes permafailure for late beta
  • Is this code covered by automated tests?: Yes
  • Has the fix been verified in Nightly?: No
  • Needs manual test from QE?: No
  • If yes, steps to reproduce:
  • List of other uplifts needed: None
  • Risk to taking this patch: Low
  • Why is the change risky/not risky? (and alternatives if risky): Test-only change
  • String changes made/needed:
  • Is Android affected?: No
Attachment #9369426 - Flags: approval-mozilla-beta?
Pushed by jdescottes@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/4d6eabdc6228 [wdspec] Do not assert each responseCompleted event in continue with auth tests r=webdriver-reviewers,whimboo
Created web-platform-tests PR https://github.com/web-platform-tests/wpt/pull/43742 for changes under testing/web-platform/tests
Status: ASSIGNED → RESOLVED
Closed: 1 year ago
Resolution: --- → FIXED
Target Milestone: --- → 123 Branch
Upstream PR merged by moz-wptsync-bot

Comment on attachment 9369426 [details]
Bug 1870816 - [wdspec] Do not assert each responseCompleted event in continue with auth tests

Approved for 122.0b3

Attachment #9369426 - Flags: approval-mozilla-beta? → approval-mozilla-beta+

Verified fixed in today's beta simulation

(In reply to Atila Butkovits from comment #13)

Verified fixed in today's beta simulation

Please disregard comment 13.

Severity: -- → S3
Points: --- → 2
Priority: -- → P1
Whiteboard: [webdriver:m9]
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: