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

WPT webdriver/tests/bidi/input/perform_actions/queue.py:test_parallel_key is flaky #2700

Open
sadym-chromium opened this issue Oct 17, 2024 · 0 comments

Comments

@sadym-chromium
Copy link
Collaborator

Example: https://github.com/GoogleChromeLabs/chromium-bidi/actions/runs/11386575484/job/31679154398?pr=2698

Tests with unexpected results:
  ▶ Unexpected subtest result in /webdriver/tests/bidi/input/perform_actions/queue.py:
  │ FAIL [expected PASS] test_parallel_key
  │   → KeyError: 'code'
  │ 
  │ bidi_session = <webdriver.bidi.client.BidiSession object at 0x7f101da4a410>
  │ top_context = {'children': [], 'clientWindow': '', 'context': 'A0413C8F6ABFE8BD81E7514793B78F39', 'originalOpener': None, ...}
  │ setup_key_test = None
  │ 
  │     async def test_parallel_key(bidi_session, top_context, setup_key_test):
  │         actions_1 = Actions()
  │         actions_1.add_key().send_keys("a").key_down(Keys.SHIFT)
  │     
  │         actions_2 = Actions()
  │         actions_2.add_key().send_keys("B").key_up(Keys.SHIFT)
  │     
  │         # Run both actions in parallel to check that they are queued for
  │         # sequential execution.
  │         actions_performed = [
  │             bidi_session.input.perform_actions(
  │                 actions=actions_1, context=top_context["context"]
  │             ),
  │             bidi_session.input.perform_actions(
  │                 actions=actions_2, context=top_context["context"]
  │             ),
  │         ]
  │         await asyncio.gather(*actions_performed)
  │     
  │         expected = [
  │             {"code": "KeyA", "key": "a", "type": "keydown"},
  │             {"code": "KeyA", "key": "a", "type": "keypress"},
  │             {"code": "KeyA", "key": "a", "type": "keyup"},
  │             {"code": "ShiftLeft", "key": "Shift", "type": "keydown"},
  │             {"code": "KeyB", "key": "B", "type": "keydown"},
  │             {"code": "KeyB", "key": "B", "type": "keypress"},
  │             {"code": "KeyB", "key": "B", "type": "keyup"},
  │             {"code": "ShiftLeft", "key": "Shift", "type": "keyup"},
  │         ]
  │     
  │         all_events = await get_events(bidi_session, top_context["context"])
  │ >       (key_events, expected) = filter_supported_key_events(all_events, expected)
  │ 
  │ actions_1  = <webdriver.bidi.modules.input.Actions object at 0x7f101da3ec10>
  │ actions_2  = <webdriver.bidi.modules.input.Actions object at 0x7f101da3da50>
  │ actions_performed = [<coroutine object Input.perform_actions at 0x7f101ee5e840>,
  │  <coroutine object Input.perform_actions at 0x7f101ee5eac0>]
  │ all_events = [{'altKey': False,
  │   'button': 0,
  │   'buttons': 0,
  │   'ctrlKey': False,
  │   'metaKey': False,
  │   'pageX': 630,
  │   'pageY': 415,
  │   'shiftKey': False,
  │   'target': '',
  │   'type': 'mousemove'},
  │  {'code': 'KeyA',
  │   'ctrl': False,
  │   'key': 'a',
  │   'location': 0,
  │   'meta': False,
  │   'repeat': False,
  │   'shift': False,
  │   'type': 'keydown',
  │   'which': 65},
  │  {'code': 'KeyA',
  │   'ctrl': False,
  │   'key': 'a',
  │   'location': 0,
  │   'meta': False,
  │   'repeat': False,
  │   'shift': False,
  │   'type': 'keypress',
  │   'which': 97},
  │  {'code': 'KeyA',
  │   'ctrl': False,
  │   'key': 'a',
  │   'location': 0,
  │   'meta': False,
  │   'repeat': False,
  │   'shift': False,
  │   'type': 'keyup',
  │   'which': 65},
  │  {'code': 'ShiftLeft',
  │   'ctrl': False,
  │   'key': 'Shift',
  │   'location': 1,
  │   'meta': False,
  │   'repeat': False,
  │   'shift': True,
  │   'type': 'keydown',
  │   'which': 16},
  │  {'code': 'KeyB',
  │   'ctrl': False,
  │   'key': 'B',
  │   'location': 0,
  │   'meta': False,
  │   'repeat': False,
  │   'shift': True,
  │   'type': 'keydown',
  │   'which': 66},
  │  {'code': 'KeyB',
  │   'ctrl': False,
  │   'key': 'B',
  │   'location': 0,
  │   'meta': False,
  │   'repeat': False,
  │   'shift': True,
  │   'type': 'keypress',
  │   'which': 66},
  │  {'code': 'KeyB',
  │   'ctrl': False,
  │   'key': 'B',
  │   'location': 0,
  │   'meta': False,
  │   'repeat': False,
  │   'shift': True,
  │   'type': 'keyup',
  │   'which': 66},
  │  {'code': 'ShiftLeft',
  │   'ctrl': False,
  │   'key': 'Shift',
  │   'location': 1,
  │   'meta': False,
  │   'repeat': False,
  │   'shift': False,
  │   'type': 'keyup',
  │   'which': 16}]
  │ bidi_session = <webdriver.bidi.client.BidiSession object at 0x7f101da4a[410](https://github.com/GoogleChromeLabs/chromium-bidi/actions/runs/11386575484/job/31679154398?pr=2698#step:12:411)>
  │ expected   = [{'code': 'KeyA', 'key': 'a', 'type': 'keydown'},
  │  {'code': 'KeyA', 'key': 'a', 'type': 'keypress'},
  │  {'code': 'KeyA', 'key': 'a', 'type': 'keyup'},
  │  {'code': 'ShiftLeft', 'key': 'Shift', 'type': 'keydown'},
  │  {'code': 'KeyB', 'key': 'B', 'type': 'keydown'},
  │  {'code': 'KeyB', 'key': 'B', 'type': 'keypress'},
  │  {'code': 'KeyB', 'key': 'B', 'type': 'keyup'},
  │  {'code': 'ShiftLeft', 'key': 'Shift', 'type': 'keyup'}]
  │ setup_key_test = None
  │ top_context = {'children': [],
  │  'clientWindow': '',
  │  'context': 'A0[413](https://github.com/GoogleChromeLabs/chromium-bidi/actions/runs/11386575484/job/31679154398?pr=2698#step:12:414)C8F6ABFE8BD81E7514793B78F39',
  │  'originalOpener': None,
  │  'parent': None,
  │  'url': 'about:blank',
  │  'userContext': 'default'}
  │ 
  │ wpt/webdriver/tests/bidi/input/perform_actions/queue.py:46: 
  │ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
  │ wpt/webdriver/tests/support/helpers.py:241: in filter_supported_key_events
  │     events = [filter_dict(e, expected[0]) for e in all_events]
  │         all_events = [{'altKey': False,
  │   'button': 0,
  │   'buttons': 0,
  │   'ctrlKey': False,
  │   'metaKey': False,
  │   'pageX': 630,
  │   'pageY': [415](https://github.com/GoogleChromeLabs/chromium-bidi/actions/runs/11386575484/job/31679154398?pr=2698#step:12:416),
  │   'shiftKey': False,
  │   'target': '',
  │   'type': 'mousemove'},
  │  {'code': 'KeyA',
  │   'ctrl': False,
  │   'key': 'a',
  │   'location': 0,
  │   'meta': False,
  │   'repeat': False,
  │   'shift': False,
  │   'type': 'keydown',
  │   'which': 65},
  │  {'code': 'KeyA',
  │   'ctrl': False,
  │   'key': 'a',
  │   'location': 0,
  │   'meta': False,
  │   'repeat': False,
  │   'shift': False,
  │   'type': 'keypress',
  │   'which': 97},
  │  {'code': 'KeyA',
  │   'ctrl': False,
  │   'key': 'a',
  │   'location': 0,
  │   'meta': False,
  │   'repeat': False,
  │   'shift': False,
  │   'type': 'keyup',
  │   'which': 65},
  │  {'code': 'ShiftLeft',
  │   'ctrl': False,
  │   'key': 'Shift',
  │   'location': 1,
  │   'meta': False,
  │   'repeat': False,
  │   'shift': True,
  │   'type': 'keydown',
  │   'which': 16},
  │  {'code': 'KeyB',
  │   'ctrl': False,
  │   'key': 'B',
  │   'location': 0,
  │   'meta': False,
  │   'repeat': False,
  │   'shift': True,
  │   'type': 'keydown',
  │   'which': 66},
  │  {'code': 'KeyB',
  │   'ctrl': False,
  │   'key': 'B',
  │   'location': 0,
  │   'meta': False,
  │   'repeat': False,
  │   'shift': True,
  │   'type': 'keypress',
  │   'which': 66},
  │  {'code': 'KeyB',
  │   'ctrl': False,
  │   'key': 'B',
  │   'location': 0,
  │   'meta': False,
  │   'repeat': False,
  │   'shift': True,
  │   'type': 'keyup',
  │   'which': 66},
  │  {'code': 'ShiftLeft',
  │   'ctrl': False,
  │   'key': 'Shift',
  │   'location': 1,
  │   'meta': False,
  │   'repeat': False,
  │   'shift': False,
  │   'type': 'keyup',
  │   'which': 16}]
  │         expected   = [{'code': 'KeyA', 'key': 'a', 'type': 'keydown'},
  │  {'code': 'KeyA', 'key': 'a', 'type': 'keypress'},
  │  {'code': 'KeyA', 'key': 'a', 'type': 'keyup'},
  │  {'code': 'ShiftLeft', 'key': 'Shift', 'type': 'keydown'},
  │  {'code': 'KeyB', 'key': 'B', 'type': 'keydown'},
  │  {'code': 'KeyB', 'key': 'B', 'type': 'keypress'},
  │  {'code': 'KeyB', 'key': 'B', 'type': 'keyup'},
  │  {'code': 'ShiftLeft', 'key': 'Shift', 'type': 'keyup'}]
  │ wpt/webdriver/tests/support/helpers.py:241: in <listcomp>
  │     events = [filter_dict(e, expected[0]) for e in all_events]
  │         .0         = <list_iterator object at 0x7f101dbf1750>
  │         e          = {'altKey': False,
  │  'button': 0,
  │  'buttons': 0,
  │  'ctrlKey': False,
  │  'metaKey': False,
  │  'pageX': 630,
  │  'pageY': 415,
  │  'shiftKey': False,
  │  'target': '',
  │  'type': 'mousemove'}
  │         expected   = [{'code': 'KeyA', 'key': 'a', 'type': 'keydown'},
  │  {'code': 'KeyA', 'key': 'a', 'type': 'keypress'},
  │  {'code': 'KeyA', 'key': 'a', 'type': 'keyup'},
  │  {'code': 'ShiftLeft', 'key': 'Shift', 'type': 'keydown'},
  │  {'code': 'KeyB', 'key': 'B', 'type': 'keydown'},
  │  {'code': 'KeyB', 'key': 'B', 'type': 'keypress'},
  │  {'code': 'KeyB', 'key': 'B', 'type': 'keyup'},
  │  {'code': 'ShiftLeft', 'key': 'Shift', 'type': 'keyup'}]
  │ wpt/webdriver/tests/support/helpers.py:237: in filter_dict
  │     return {k: source[k] for k in d.keys()}
  │         d          = {'code': 'KeyA', 'key': 'a', 'type': 'keydown'}
  │         source     = {'altKey': False,
  │  'button': 0,
  │  'buttons': 0,
  │  'ctrlKey': False,
  │  'metaKey': False,
  │  'pageX': 630,
  │  'pageY': 415,
  │  'shiftKey': False,
  │  'target': '',
  │  'type': 'mousemove'}
  │ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
  │ 
  │ .0 = <dict_keyiterator object at 0x7f101da3bab0>
  │ 
  │ >   return {k: source[k] for k in d.keys()}
  │ E   KeyError: 'code'
  │ 
  │ .0         = <dict_keyiterator object at 0x7f101da3bab0>
  │ k          = 'code'
  │ source     = {'altKey': False,
  │  'button': 0,
  │  'buttons': 0,
  │  'ctrlKey': False,
  │  'metaKey': False,
  │  'pageX': 630,
  │  'pageY': 415,
  │  'shiftKey': False,
  │  'target': '',
  │  'type': 'mousemove'}
  │ 
  └ wpt/webdriver/tests/support/helpers.py:237: KeyError
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant