Skip to content

webdriver: Synchronize navigation state with constellation inside wait - #50183

Merged
yezhizhen merged 2 commits into
servo:mainfrom
yezhizhen:wd
Nov 27, 2026
Merged

yezhizhen merged 2 commits into
servo:mainfrom
yezhizhen:wd

Conversation

@yezhizhen

@yezhizhen yezhizhen commented Nov 24, 2026 •

Copy link
Copy Markdown
Member

A navigation started by script (e.g., from click) could be missed since
wait_for_navigation_to_complete is decided from a cache local to server.

This allows us to remove some duplication, where we keep calling synchronize_navigation_state
before wait_for_navigation_to_complete, which also fixes an edge case:
we forgot to do sync here:

self.session()?;
// Step 6.4: wait for navigation to complete before running the command.
// <https://w3c.github.io/webdriver/#processing-model>
self.wait_for_navigation_to_complete()?;
, which runs before each command.

The second commit fixes the deadlock: a user prompt pauses load until dismissed, so early return.
That would be dismissed soon, as all commands have handle_any_user_prompts step.

Testing: Tested locally, and the url assertion mismatch is gone.
Fixes: #47582

@servo-highfive servo-highfive added the S-awaiting-review There is new code that needs to be reviewed. label Nov 24, 2026
@yezhizhen yezhizhen added the T-linux-wpt Do a try run of the WPT label Nov 24, 2026
@github-actions github-actions Bot removed the T-linux-wpt Do a try run of the WPT label Nov 24, 2026
@github-actions

Copy link
Copy Markdown

🔨 Triggering try run (#45423878802) for Linux (WPT)

@TimvdLippe

Copy link
Copy Markdown
Contributor

Does this also fix #50169 and #50054 ? Since they are also about user prompts

@yezhizhen

Copy link
Copy Markdown
Member Author

Does this also fix #50169 and #50054 ? Since they are also about user prompts

Probably not. Since the commit 2 fixes issues only introduced by commit 1.

@github-actions

Copy link
Copy Markdown

Test results for linux-wpt from try job (#45423878802):

Flaky unexpected result (24)
  • OK /IndexedDB/idbtransaction-oncomplete.any.html (#42845)
    • FAIL [expected PASS] subtest: IDBTransaction - complete event

      assert_array_equals: lengths differ, expected array ["upgradeneeded", "complete", "success", "opencursor"] length 4, got ["upgradeneeded", "complete", "success"] length 3
      

  • CRASH [expected OK] /_webgl/conformance2/wasm/readpixels-2gb-in-4gb-wasm-memory.html
  • OK /beacon/beacon-basic.https.window.html (#41723)
    • FAIL [expected PASS] subtest: Payload size restriction should be accumulated: type = arraybuffer

      assert_false: expected false got true
      

  • FAIL [expected PASS] /css/css-backgrounds/background-size-041.html
  • OK /css/css-fonts/variations/at-font-face-font-matching.html (#20684)
    • FAIL [expected PASS] subtest: Matching font-style: 'oblique 10deg' should prefer 'oblique 10deg' over 'oblique 5deg'

      assert_equals: Unexpected font on test element expected 487 but got 532
      

  • OK /dom/nodes/moveBefore/iframe-document-preserve.window.html (#43152)
    • FAIL [expected PASS] subtest: moveBefore(): cross-origin iframe is preserved: remove self via innerHTML

      assert_equals: iframe does not fire a second load event expected 1 but got 0
      

  • OK /fetch/content-disposition/multiple-content-disposition.tentative.any.html (#49234)
    • FAIL [expected PASS] subtest: HTTP/1.1: differing duplicate Content-Disposition headers are not a network error

      promise_test: Unhandled rejection with value: object "TypeError: Network error: HTTP failure: client error (SendRequest)"
      

  • OK /html/browsers/browsing-the-web/navigating-across-documents/refresh/same-document-refresh.html (#34597)
    • FAIL [expected PASS] subtest: Same-Document Referrer from Refresh

      assert_equals: original page loads expected "http://web-platform.test:8000/html/browsers/browsing-the-web/navigating-across-documents/refresh/resources/refresh-with-section.sub.html?url=%23section" but got "http://web-platform.test:8000/html/browsers/browsing-the-web/navigating-across-documents/refresh/resources/refresh-with-section.sub.html?url=%23section#section"
      

  • CRASH [expected TIMEOUT] /html/browsers/browsing-the-web/navigating-across-documents/replace-before-load/window-open-popup-during-load.html
  • TIMEOUT [expected OK] /html/browsers/windows/consume-user-activation/window-open-multi-global.html (#47399)
    • TIMEOUT [expected FAIL] subtest: window.open() and consuming user activation with multiple globals in play

      Test timed out
      

  • CRASH [expected OK] /html/canvas/element/drawing-images-to-the-canvas/2d.drawImage.negativedir.html
  • TIMEOUT /html/semantics/embedded-content/media-elements/preserves-pitch.html (#49303)
    • PASS [expected TIMEOUT] subtest: Speed-ups should not change the pitch when preservesPitch=true
    • TIMEOUT [expected NOTRUN] subtest: Slow-downs should not change the pitch when preservesPitch=true

      Test timed out
      

  • CRASH [expected OK] /html/semantics/embedded-content/the-img-element/attr-img-fetchpriority.html
  • CRASH [expected OK] /html/semantics/embedded-content/the-img-element/below-viewport-image-loading-lazy-load-event.html
  • CRASH [expected FAIL] /html/semantics/interestfor/interestfor-plain-inline-element.tentative.html
  • TIMEOUT [expected OK] /html/user-activation/navigation-state-reset-sameorigin.html (#45151)
    • TIMEOUT [expected FAIL] subtest: Post-navigation state reset.

      Test timed out
      

  • OK /infrastructure/testdriver/click_iframe.html (#47688)
    • FAIL [expected PASS] subtest: TestDriver click on a document in an iframe

      Unhandled rejection: assert_unreached: click failed Reached unreachable code
      

  • FAIL [expected PASS] /mathml/presentation-markup/operators/mo-form-dynamic-002.html (#49169)
  • PASS [expected FAIL] /mathml/presentation-markup/operators/mo-lspace-rspace-dynamic.html (#49168)
  • PASS [expected FAIL] /mathml/presentation-markup/operators/operator-dictionary-empty-and-three-chars.html (#49173)
  • OK /preload/prefetch-document.html (#37210)
    • FAIL [expected PASS] subtest: different-site document prefetch with 'as=document' should not be consumed

      assert_equals: expected 2 but got 1
      

  • OK /upgrade-insecure-requests/gen/sharedworker-classic-data.meta/upgrade/websocket.https.html
    • FAIL [expected PASS] subtest: Upgrade-Insecure-Requests: Expects allowed for websocket to cross-ws-downgrade origin and no-redirect redirection from https context.

      assert_equals: The resource request should be 'allowed'. expected "allowed" but got "blocked"
      

    • FAIL [expected PASS] subtest: Upgrade-Insecure-Requests: Expects allowed for websocket to same-ws-downgrade origin and no-redirect redirection from https context.

      assert_equals: The resource request should be 'allowed'. expected "allowed" but got "blocked"
      

  • OK /webdriver/tests/classic/get_current_url/user_prompts.py
    • ERROR [expected PASS] subtest: test_accept[alert-None]

      setup error: ConnectionRefusedError: [Errno 111] Connection refused
      

    • ERROR [expected PASS] subtest: test_accept[confirm-True]

      setup error: ConnectionRefusedError: [Errno 111] Connection refused
      

    • ERROR [expected PASS] subtest: test_accept[prompt-]

      setup error: ConnectionRefusedError: [Errno 111] Connection refused
      

    • ERROR [expected PASS] subtest: test_accept_and_notify[alert-None]

      setup error: ConnectionRefusedError: [Errno 111] Connection refused
      

    • ERROR [expected PASS] subtest: test_accept_and_notify[confirm-True]

      setup error: ConnectionRefusedError: [Errno 111] Connection refused
      

    • ERROR [expected PASS] subtest: test_accept_and_notify[prompt-]

      setup error: ConnectionRefusedError: [Errno 111] Connection refused
      

    • ERROR [expected PASS] subtest: test_dismiss[alert-None]

      setup error: ConnectionRefusedError: [Errno 111] Connection refused
      

    • ERROR [expected PASS] subtest: test_dismiss[confirm-False]

      setup error: ConnectionRefusedError: [Errno 111] Connection refused
      

    • ERROR [expected PASS] subtest: test_dismiss[prompt-None]

      setup error: ConnectionRefusedError: [Errno 111] Connection refused
      

    • ERROR [expected PASS] subtest: test_dismiss_and_notify[alert-None]

      setup error: ConnectionRefusedError: [Errno 111] Connection refused
      

    • And 8 more unexpected results...
  • OK /webdriver/tests/classic/get_title/user_prompts.py
    • ERROR [expected PASS] subtest: test_accept[alert-None]

      setup error: ConnectionRefusedError: [Errno 111] Connection refused
      

    • ERROR [expected PASS] subtest: test_accept[confirm-True]

      setup error: ConnectionRefusedError: [Errno 111] Connection refused
      

    • ERROR [expected PASS] subtest: test_accept[prompt-]

      setup error: ConnectionRefusedError: [Errno 111] Connection refused
      

    • ERROR [expected PASS] subtest: test_accept_and_notify[alert-None]

      setup error: ConnectionRefusedError: [Errno 111] Connection refused
      

    • ERROR [expected PASS] subtest: test_accept_and_notify[confirm-True]

      setup error: ConnectionRefusedError: [Errno 111] Connection refused
      

    • ERROR [expected PASS] subtest: test_accept_and_notify[prompt-]

      setup error: ConnectionRefusedError: [Errno 111] Connection refused
      

    • ERROR [expected PASS] subtest: test_dismiss[alert-None]

      setup error: ConnectionRefusedError: [Errno 111] Connection refused
      

    • ERROR [expected PASS] subtest: test_dismiss[confirm-False]

      setup error: ConnectionRefusedError: [Errno 111] Connection refused
      

    • ERROR [expected PASS] subtest: test_dismiss[prompt-None]

      setup error: ConnectionRefusedError: [Errno 111] Connection refused
      

    • ERROR [expected PASS] subtest: test_dismiss_and_notify[alert-None]

      setup error: ConnectionRefusedError: [Errno 111] Connection refused
      

    • And 8 more unexpected results...
Stable unexpected results that are known to be intermittent (7)
  • OK /css/CSS2/visudet/inline-block-baseline-with-block-in-inline-001.html (#49559)
    • PASS [expected FAIL] subtest: An inline-block whose last line box holds a block level box exports that line's baseline
  • CRASH [expected TIMEOUT] /dom/xpath-evaluation-detached-nodes.html (#49715)
  • TIMEOUT /html/browsers/history/the-history-interface/001.html (#12580)
    • FAIL [expected PASS] subtest: traversing history must also traverse hash changes

      assert_equals: (this could cause other failures later on) expected "" but got "test"
      

  • ERROR [expected OK] /html/semantics/forms/the-input-element/show-picker-disabled-readonly.html (#50169)
  • OK /pointerevents/pointerevent_pointercapture_in_frame.html?pen (#45536)
    • PASS [expected FAIL] subtest: Test penpointer capture in same-origin frame: Pointer down at inner frame and set pointer capture.
    • PASS [expected FAIL] subtest: Test penpointer capture in same-origin frame: Pointer down at inner frame and set pointer capture to outer frame should not capture.
  • OK /user-timing/measure_associated_with_navigation_timing.html (#47273)
    • FAIL [expected PASS] subtest: loadTime plus loadEventEnd to a mark "a" should equal to navigationStart to "a".

      assert_equals: loadTime plus loadEventEnd to a mark "a" should equal to navigationStart to "a". expected 12.49 but got 12.48
      

  • OK [expected TIMEOUT] /webdriver/tests/classic/perform_actions/navigation.py (#38822)

@github-actions

Copy link
Copy Markdown

✨ Try run (#45423878802) succeeded.

@yezhizhen

Copy link
Copy Markdown
Member Author

OK [expected TIMEOUT] /webdriver/tests/classic/perform_actions/navigation.py

Will check this tomorrow.

@yezhizhen
yezhizhen marked this pull request as draft November 24, 2026 16:23
@yezhizhen

Copy link
Copy Markdown
Member Author

OK [expected TIMEOUT] /webdriver/tests/classic/perform_actions/navigation.py

Will check this tomorrow.

This one still not fixed, related to send keys which is separate.

@yezhizhen
yezhizhen marked this pull request as ready for review November 25, 2026 04:09
@servo-highfive servo-highfive removed the S-awaiting-review There is new code that needs to be reviewed. label Nov 27, 2026
@yezhizhen
yezhizhen added this pull request to the merge queue Nov 27, 2026
@servo-highfive servo-highfive added the S-awaiting-merge The PR is in the process of compiling and running tests on the automated CI. label Nov 27, 2026
Merged via the queue into servo:main with commit 74e17f9 Nov 27, 2026
80 checks passed
@yezhizhen
yezhizhen deleted the wd branch November 27, 2026 14:10
@servo-highfive servo-highfive removed the S-awaiting-merge The PR is in the process of compiling and running tests on the automated CI. label Nov 27, 2026
devin-ai-integration Bot pushed a commit to baigojahanzaib/servo that referenced this pull request Nov 27, 2026
servo#50183)

A navigation started by script (e.g., from click) could be missed since
`wait_for_navigation_to_complete` is decided from a cache local to
server.

This allows us to remove some duplication, where we keep calling
`synchronize_navigation_state`
before `wait_for_navigation_to_complete`, which also fixes an edge case:
we forgot to do sync here:
https://github.com/servo/servo/blob/6de1455c7311cbd1ae3de0a5ff6f5db754cd71f1/components/webdriver_server/lib.rs#L2729-L2732,
which runs before each command.

The second commit fixes the deadlock: a user prompt pauses load until
dismissed, so early return.
That would be dismissed soon, as all commands have
[handle_any_user_prompts](https://w3c.github.io/webdriver/#dfn-handle-any-user-prompts)
step.

Testing: Tested locally, and the url assertion mismatch is gone.
Fixes: servo#47582

---------

Signed-off-by: Euclid Ye <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Intermittent failure in /webdriver/tests/classic/element_click/navigate.py

4 participants