Skip to content

Intermittent FAIL in /webdriver/tests/classic/element_click/single_tick.py #48249

Open

Description

Activity

  1. added
    I-intermittent
    on Sep 21, 2026
  2. jdm commented on Sep 21, 2026

    @jdm
    Member
      ▶ OK /webdriver/tests/classic/element_click/single_tick.py
      │   ▶ FAIL [expected PASS] test_element_click_dispatches_actions_in_a_single_tick
      │   │   → assert not True
      │   │ 
      │   │ session = <Session 8fe2abdf-56d4-4708-b965-ee5d4bf3bbce>
      │   │ inline = <function inline.<locals>.inline at 0x7ff956aa04a0>
      │   │ 
      │   │     def test_element_click_dispatches_actions_in_a_single_tick(session, inline):
      │   │         """Element click dispatches its pointer actions in a single tick.
      │   │     
      │   │         Per https://w3c.github.io/webdriver/#dfn-dispatch-a-list-of-actions
      │   │         the pointer move/down/up actions of element click form a single tick,
      │   │         so the remote end must not spin the event loop between dispatching
      │   │         them. We detect an event-loop turn by scheduling a macrotask in a
      │   │         mousedown listener and checking, from a mouseup listener, that it has
      │   │         not run yet.
      │   │         """
      │   │         session.url = inline("""
      │   │             <div id="target">click me</div>
      │   │             <script>
      │   │                 window.addEventListener("mousedown", () => {
      │   │                     window.__timer_ran = false;
      │   │                     setTimeout(() => { window.__timer_ran = true; }, 0);
      │   │                 });
      │   │                 window.addEventListener("mouseup", () => {
      │   │                     window.__ran_when_mouseup = window.__timer_ran;
      │   │                 });
      │   │             </script>
      │   │         """)
      │   │         element = session.find.css("#target", all=False)
      │   │     
      │   │         response = element_click(session, element)
      │   │         assert_success(response)
      │   │     
      │   │         # Manual wait as Chromium currently fail "test_spin_event_loop"
      │   │         time.sleep(1)
      │   │         timer_ran = session.execute_script("return window.__timer_ran;")
      │   │         assert timer_ran
      │   │     
      │   │         ran_when_mouseup = session.execute_script("return window.__ran_when_mouseup;")
      │   │ >       assert not ran_when_mouseup
      │   │ E       assert not True
      │   │ 
      │   │ element    = <WebElement f0d9947ee06c42be827a156cc5f3388a>
      │   │ inline     = <function inline.<locals>.inline at 0x7ff956aa04a0>
      │   │ ran_when_mouseup = True
      │   │ response   = <Response: status=200 body={"value": null}>
      │   │ session    = <Session 8fe2abdf-56d4-4708-b965-ee5d4bf3bbce>
      │   │ timer_ran  = True
      │   │ 
      └   └ tests/wpt/tests/webdriver/tests/classic/element_click/single_tick.py:44: AssertionError
    
    
  3. added
    A-content/script
    on Sep 21, 2026
  4. jdm commented on Sep 21, 2026

    @jdm
    Member

    I'm actually surprised we ever pass this test. Our implementation send one input event to the script thread at a time:

    fn dispatch_tick_actions(

    I guess when it's racing against the ti er sometimes we happen to process all those tasks before the timer task.

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-content/scriptA-webdriverI-intermittent

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions