Open Bug 1959516 Opened 14 days ago Updated 10 days ago

Intermittent /webdriver/tests/bidi/emulation/set_geolocation_override/coordinates.py | test_watch_position - AssertionError: assert {'latitude': 37.41857, 'longitude': -122.08769, 'accuracy': 42} == {'latitude': 20, 'longitude': 10, 'accuracy': 1}

Categories

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

defect

Tracking

(Not tracked)

People

(Reporter: intermittent-bug-filer, Unassigned)

Details

(Keywords: intermittent-failure)

Filed by: pstanciu [at] mozilla.com
Parsed log: https://treeherder.mozilla.org/logviewer?job_id=503152712&repo=mozilla-central
Full log: https://firefox-ci-tc.services.mozilla.com/api/queue/v1/task/UJsM59JfSy-LbWTBC1A0PA/runs/0/artifacts/public/logs/live_backing.log


[task 2025-04-09T17:34:29.552Z] 17:34:29     INFO - STDOUT: ========================= 1 failed, 8 passed in 38.93s =========================
[task 2025-04-09T17:34:29.558Z] 17:34:29     INFO - 
[task 2025-04-09T17:34:29.558Z] 17:34:29     INFO - TEST-PASS | /webdriver/tests/bidi/emulation/set_geolocation_override/coordinates.py | test_get_current_position[test_coordinates0] 
[task 2025-04-09T17:34:29.558Z] 17:34:29     INFO - TEST-PASS | /webdriver/tests/bidi/emulation/set_geolocation_override/coordinates.py | test_get_current_position[test_coordinates1] 
[task 2025-04-09T17:34:29.558Z] 17:34:29     INFO - TEST-PASS | /webdriver/tests/bidi/emulation/set_geolocation_override/coordinates.py | test_get_current_position[test_coordinates2] 
[task 2025-04-09T17:34:29.558Z] 17:34:29     INFO - TEST-PASS | /webdriver/tests/bidi/emulation/set_geolocation_override/coordinates.py | test_get_current_position[test_coordinates3] 
[task 2025-04-09T17:34:29.559Z] 17:34:29     INFO - TEST-PASS | /webdriver/tests/bidi/emulation/set_geolocation_override/coordinates.py | test_get_current_position[test_coordinates4] 
[task 2025-04-09T17:34:29.559Z] 17:34:29     INFO - TEST-PASS | /webdriver/tests/bidi/emulation/set_geolocation_override/coordinates.py | test_get_current_position[test_coordinates5] 
[task 2025-04-09T17:34:29.559Z] 17:34:29     INFO - TEST-UNEXPECTED-FAIL | /webdriver/tests/bidi/emulation/set_geolocation_override/coordinates.py | test_watch_position - AssertionError: assert {'latitude': 37.41857, 'longitude': -122.08769, 'accuracy': 42} == {'latitude': 20, 'longitude': 10, 'accuracy': 1}
[task 2025-04-09T17:34:29.559Z] 17:34:29     INFO - bidi_session = <webdriver.bidi.client.BidiSession object at 0x7f6ae5715fa0>
[task 2025-04-09T17:34:29.559Z] 17:34:29     INFO - new_tab = {'context': '052e1ba4-4aad-4560-aa8e-056f21340dd1'}
[task 2025-04-09T17:34:29.559Z] 17:34:29     INFO - url = <function url.<locals>.url at 0x7f6ae56c1160>
[task 2025-04-09T17:34:29.560Z] 17:34:29     INFO - subscribe_events = <function subscribe_events.<locals>.subscribe_events at 0x7f6ae56c14c0>
[task 2025-04-09T17:34:29.560Z] 17:34:29     INFO - wait_for_event = <function wait_for_event.<locals>.wait_for_event at 0x7f6ae56c13a0>
[task 2025-04-09T17:34:29.560Z] 17:34:29     INFO - wait_for_future_safe = <function wait_for_future_safe.<locals>.wait_for_future_safe at 0x7f6ae56c1550>
[task 2025-04-09T17:34:29.560Z] 17:34:29     INFO - set_geolocation_permission = <function set_geolocation_permission.<locals>.set_geolocation_permission at 0x7f6ae56c1820>
[task 2025-04-09T17:34:29.560Z] 17:34:29     INFO - 
[task 2025-04-09T17:34:29.560Z] 17:34:29     INFO -     async def test_watch_position(
[task 2025-04-09T17:34:29.560Z] 17:34:29     INFO -         bidi_session,
[task 2025-04-09T17:34:29.560Z] 17:34:29     INFO -         new_tab,
[task 2025-04-09T17:34:29.560Z] 17:34:29     INFO -         url,
[task 2025-04-09T17:34:29.560Z] 17:34:29     INFO -         subscribe_events,
[task 2025-04-09T17:34:29.560Z] 17:34:29     INFO -         wait_for_event,
[task 2025-04-09T17:34:29.560Z] 17:34:29     INFO -         wait_for_future_safe,
[task 2025-04-09T17:34:29.561Z] 17:34:29     INFO -         set_geolocation_permission,
[task 2025-04-09T17:34:29.561Z] 17:34:29     INFO -     ):
[task 2025-04-09T17:34:29.561Z] 17:34:29     INFO -         await subscribe_events(["script.message"])
[task 2025-04-09T17:34:29.561Z] 17:34:29     INFO -     
[task 2025-04-09T17:34:29.561Z] 17:34:29     INFO -         test_url = url("/common/blank.html")
[task 2025-04-09T17:34:29.561Z] 17:34:29     INFO -         await bidi_session.browsing_context.navigate(
[task 2025-04-09T17:34:29.561Z] 17:34:29     INFO -             context=new_tab["context"],
[task 2025-04-09T17:34:29.561Z] 17:34:29     INFO -             url=test_url,
[task 2025-04-09T17:34:29.562Z] 17:34:29     INFO -             wait="complete",
[task 2025-04-09T17:34:29.562Z] 17:34:29     INFO -         )
[task 2025-04-09T17:34:29.562Z] 17:34:29     INFO -         await set_geolocation_permission(new_tab)
[task 2025-04-09T17:34:29.562Z] 17:34:29     INFO -     
[task 2025-04-09T17:34:29.562Z] 17:34:29     INFO -         test_override_1 = {"latitude": 0, "longitude": 0, "accuracy": 1}
[task 2025-04-09T17:34:29.562Z] 17:34:29     INFO -         await bidi_session.emulation.set_geolocation_override(
[task 2025-04-09T17:34:29.562Z] 17:34:29     INFO -             contexts=[new_tab["context"]],
[task 2025-04-09T17:34:29.562Z] 17:34:29     INFO -             coordinates=CoordinatesOptions(
[task 2025-04-09T17:34:29.562Z] 17:34:29     INFO -                 latitude=test_override_1["latitude"],
[task 2025-04-09T17:34:29.563Z] 17:34:29     INFO -                 longitude=test_override_1["longitude"],
[task 2025-04-09T17:34:29.563Z] 17:34:29     INFO -                 accuracy=test_override_1["accuracy"],
[task 2025-04-09T17:34:29.563Z] 17:34:29     INFO -             ),
[task 2025-04-09T17:34:29.563Z] 17:34:29     INFO -         )
[task 2025-04-09T17:34:29.563Z] 17:34:29     INFO -     
[task 2025-04-09T17:34:29.563Z] 17:34:29     INFO -         on_script_message = wait_for_event("script.message")
[task 2025-04-09T17:34:29.563Z] 17:34:29     INFO -         await bidi_session.browsing_context.activate(context=new_tab["context"])
[task 2025-04-09T17:34:29.563Z] 17:34:29     INFO -         watch_id = await bidi_session.script.call_function(
[task 2025-04-09T17:34:29.563Z] 17:34:29     INFO -             arguments=[{"type": "channel", "value": {"channel": "channel_name"}}],
[task 2025-04-09T17:34:29.563Z] 17:34:29     INFO -             function_declaration="""(channel) =>
[task 2025-04-09T17:34:29.563Z] 17:34:29     INFO -                 window.navigator.geolocation.watchPosition(
[task 2025-04-09T17:34:29.563Z] 17:34:29     INFO -                     (result) => channel(result.coords.toJSON())
[task 2025-04-09T17:34:29.564Z] 17:34:29     INFO -                 )
[task 2025-04-09T17:34:29.564Z] 17:34:29     INFO -             """,
[task 2025-04-09T17:34:29.564Z] 17:34:29     INFO -             target=ContextTarget(new_tab["context"]),
[task 2025-04-09T17:34:29.564Z] 17:34:29     INFO -             await_promise=False,
[task 2025-04-09T17:34:29.564Z] 17:34:29     INFO -         )
[task 2025-04-09T17:34:29.564Z] 17:34:29     INFO -         event_data = await wait_for_future_safe(on_script_message)
[task 2025-04-09T17:34:29.564Z] 17:34:29     INFO -     
[task 2025-04-09T17:34:29.564Z] 17:34:29     INFO -         assert remote_mapping_to_dict(event_data["data"]["value"]) == test_override_1
[task 2025-04-09T17:34:29.564Z] 17:34:29     INFO -     
[task 2025-04-09T17:34:29.564Z] 17:34:29     INFO -         test_override_2 = {"latitude": 10, "longitude": 10, "accuracy": 3}
[task 2025-04-09T17:34:29.564Z] 17:34:29     INFO -         on_script_message = wait_for_event("script.message")
[task 2025-04-09T17:34:29.564Z] 17:34:29     INFO -         await bidi_session.emulation.set_geolocation_override(
[task 2025-04-09T17:34:29.564Z] 17:34:29     INFO -             contexts=[new_tab["context"]],
[task 2025-04-09T17:34:29.565Z] 17:34:29     INFO -             coordinates=CoordinatesOptions(
[task 2025-04-09T17:34:29.565Z] 17:34:29     INFO -                 latitude=test_override_2["latitude"],
[task 2025-04-09T17:34:29.565Z] 17:34:29     INFO -                 longitude=test_override_2["longitude"],
[task 2025-04-09T17:34:29.565Z] 17:34:29     INFO -                 accuracy=test_override_2["accuracy"],
[task 2025-04-09T17:34:29.565Z] 17:34:29     INFO -             ),
[task 2025-04-09T17:34:29.565Z] 17:34:29     INFO -         )
[task 2025-04-09T17:34:29.565Z] 17:34:29     INFO -         event_data = await wait_for_future_safe(on_script_message)
[task 2025-04-09T17:34:29.565Z] 17:34:29     INFO -     
[task 2025-04-09T17:34:29.565Z] 17:34:29     INFO -         assert remote_mapping_to_dict(event_data["data"]["value"]) == test_override_2
[task 2025-04-09T17:34:29.565Z] 17:34:29     INFO -     
[task 2025-04-09T17:34:29.566Z] 17:34:29     INFO -         test_override_3 = {"latitude": 20, "longitude": 10, "accuracy": 1}
[task 2025-04-09T17:34:29.566Z] 17:34:29     INFO -         on_script_message = wait_for_event("script.message")
[task 2025-04-09T17:34:29.566Z] 17:34:29     INFO -         await bidi_session.emulation.set_geolocation_override(
[task 2025-04-09T17:34:29.566Z] 17:34:29     INFO -             contexts=[new_tab["context"]],
[task 2025-04-09T17:34:29.566Z] 17:34:29     INFO -             coordinates=CoordinatesOptions(
[task 2025-04-09T17:34:29.566Z] 17:34:29     INFO -                 latitude=test_override_3["latitude"],
[task 2025-04-09T17:34:29.566Z] 17:34:29     INFO -                 longitude=test_override_3["longitude"],
[task 2025-04-09T17:34:29.566Z] 17:34:29     INFO -                 accuracy=test_override_3["accuracy"],
[task 2025-04-09T17:34:29.566Z] 17:34:29     INFO -             ),
[task 2025-04-09T17:34:29.566Z] 17:34:29     INFO -         )
[task 2025-04-09T17:34:29.566Z] 17:34:29     INFO -         event_data = await wait_for_future_safe(on_script_message)
[task 2025-04-09T17:34:29.566Z] 17:34:29     INFO -     
[task 2025-04-09T17:34:29.566Z] 17:34:29     INFO - >       assert remote_mapping_to_dict(event_data["data"]["value"]) == test_override_3
[task 2025-04-09T17:34:29.566Z] 17:34:29     INFO - E       AssertionError: assert {'latitude': 37.41857, 'longitude': -122.08769, 'accuracy': 42} == {'latitude': 20, 'longitude': 10, 'accuracy': 1}
[task 2025-04-09T17:34:29.567Z] 17:34:29     INFO - E         
[task 2025-04-09T17:34:29.567Z] 17:34:29     INFO - E         Differing items:
[task 2025-04-09T17:34:29.567Z] 17:34:29     INFO - E         {'accuracy': 42} != {'accuracy': 1}
[task 2025-04-09T17:34:29.567Z] 17:34:29     INFO - E         {'latitude': 37.41857} != {'latitude': 20}
[task 2025-04-09T17:34:29.567Z] 17:34:29     INFO - E         {'longitude': -122.08769} != {'longitude': 10}
[task 2025-04-09T17:34:29.567Z] 17:34:29     INFO - E         
[task 2025-04-09T17:34:29.567Z] 17:34:29     INFO - E         Full diff:
[task 2025-04-09T17:34:29.567Z] 17:34:29     INFO - E           {
[task 2025-04-09T17:34:29.567Z] 17:34:29     INFO - E         -     'accuracy': 1,
[task 2025-04-09T17:34:29.567Z] 17:34:29     INFO - E         ?                 ^
[task 2025-04-09T17:34:29.567Z] 17:34:29     INFO - E         +     'accuracy': 42,
[task 2025-04-09T17:34:29.568Z] 17:34:29     INFO - E         ?                 ^^
[task 2025-04-09T17:34:29.568Z] 17:34:29     INFO - E         -     'latitude': 20,
[task 2025-04-09T17:34:29.568Z] 17:34:29     INFO - E         ?                 ^^
[task 2025-04-09T17:34:29.568Z] 17:34:29     INFO - E         +     'latitude': 37.41857,
[task 2025-04-09T17:34:29.568Z] 17:34:29     INFO - E         ?                 ^^^^^^^^
[task 2025-04-09T17:34:29.568Z] 17:34:29     INFO - E         -     'longitude': 10,
[task 2025-04-09T17:34:29.569Z] 17:34:29     INFO - E         +     'longitude': -122.08769,
[task 2025-04-09T17:34:29.569Z] 17:34:29     INFO - E         ?                  + +++ ++++
[task 2025-04-09T17:34:29.569Z] 17:34:29     INFO - E           }
[task 2025-04-09T17:34:29.569Z] 17:34:29     INFO - 
[task 2025-04-09T17:34:29.570Z] 17:34:29     INFO - bidi_session = <webdriver.bidi.client.BidiSession object at 0x7f6ae5715fa0>
[task 2025-04-09T17:34:29.570Z] 17:34:29     INFO - event_data = {'channel': 'channel_name',
[task 2025-04-09T17:34:29.570Z] 17:34:29     INFO -  'data': {'type': 'object',
[task 2025-04-09T17:34:29.570Z] 17:34:29     INFO -           'value': [['latitude', {'type': 'number', 'value': 37.41857}],
[task 2025-04-09T17:34:29.570Z] 17:34:29     INFO -                     ['longitude', {'type': 'number', 'value': -122.08769}],
[task 2025-04-09T17:34:29.570Z] 17:34:29     INFO -                     ['altitude', {'type': 'null'}],
[task 2025-04-09T17:34:29.570Z] 17:34:29     INFO -                     ['accuracy', {'type': 'number', 'value': 42}],
[task 2025-04-09T17:34:29.570Z] 17:34:29     INFO -                     ['altitudeAccuracy', {'type': 'null'}],
[task 2025-04-09T17:34:29.570Z] 17:34:29     INFO -                     ['heading', {'type': 'null'}],
[task 2025-04-09T17:34:29.570Z] 17:34:29     INFO -                     ['speed', {'type': 'null'}]]},
[task 2025-04-09T17:34:29.571Z] 17:34:29     INFO -  'source': {'context': '052e1ba4-4aad-4560-aa8e-056f21340dd1',
[task 2025-04-09T17:34:29.571Z] 17:34:29     INFO -             'realm': '27f8c258-33be-41a5-9a9f-6c25b8da9f0b'}}
[task 2025-04-09T17:34:29.571Z] 17:34:29     INFO - new_tab    = {'context': '052e1ba4-4aad-4560-aa8e-056f21340dd1'}
[task 2025-04-09T17:34:29.571Z] 17:34:29     INFO - on_script_message = <Future finished result={'channel': 'channel_name', 'data': {'type': 'object', 'value': [['latitude', {'type': 'number', 'value': 37.41857}], ['longitude', {'type': 'number', 'value': -122.08769}], ['altitude', {'type': 'null'}], ['accuracy', {'type': 'number', 'value': 42}], ['altitudeAccuracy', {'type': 'null'}], ['heading', {'type': 'null'}], ...]}, 'source': {'context': '052e1ba4-4aa...-056f21340dd1', 'realm': '27f8c258-33b...-6c25b8da9f0b'}}>
[task 2025-04-09T17:34:29.571Z] 17:34:29     INFO - set_geolocation_permission = <function set_geolocation_permission.<locals>.set_geolocation_permission at 0x7f6ae56c1820>
[task 2025-04-09T17:34:29.571Z] 17:34:29     INFO - subscribe_events = <function subscribe_events.<locals>.subscribe_events at 0x7f6ae56c14c0>
[task 2025-04-09T17:34:29.571Z] 17:34:29     INFO - test_override_1 = {'accuracy': 1, 'latitude': 0, 'longitude': 0}
[task 2025-04-09T17:34:29.572Z] 17:34:29     INFO - test_override_2 = {'accuracy': 3, 'latitude': 10, 'longitude': 10}
[task 2025-04-09T17:34:29.572Z] 17:34:29     INFO - test_override_3 = {'accuracy': 1, 'latitude': 20, 'longitude': 10}
[task 2025-04-09T17:34:29.572Z] 17:34:29     INFO - test_url   = 'https://web-platform.test:8443/common/blank.html'
[task 2025-04-09T17:34:29.572Z] 17:34:29     INFO - url        = <function url.<locals>.url at 0x7f6ae56c1160>
[task 2025-04-09T17:34:29.572Z] 17:34:29     INFO - wait_for_event = <function wait_for_event.<locals>.wait_for_event at 0x7f6ae56c13a0>
[task 2025-04-09T17:34:29.572Z] 17:34:29     INFO - wait_for_future_safe = <function wait_for_future_safe.<locals>.wait_for_future_safe at 0x7f6ae56c1550>
[task 2025-04-09T17:34:29.572Z] 17:34:29     INFO - watch_id   = {'type': 'number', 'value': 1}
[task 2025-04-09T17:34:29.572Z] 17:34:29     INFO - 
[task 2025-04-09T17:34:29.573Z] 17:34:29     INFO - tests/web-platform/tests/webdriver/tests/bidi/emulation/set_geolocation_override/coordinates.py:121: AssertionError
[task 2025-04-09T17:34:29.573Z] 17:34:29     INFO - ..
[task 2025-04-09T17:34:29.573Z] 17:34:29     INFO - TEST-OK | /webdriver/tests/bidi/emulation/set_geolocation_override/coordinates.py | took 39067ms
[task 2025-04-09T17:34:29.663Z] 17:34:29     INFO - Closing logging queue

We got 2 messages instead of one, one with overridden position and one with original:

task 2025-04-09T17:34:14.884Z] 17:34:14     INFO - PID 17304 | 1744220054882	RemoteAgent	DEBUG	WebDriverBiDiConnection 4e1c5bd8-cd2b-453e-9b3c-2148770b76f0 -> {"id":75,"method":"emulation.setGeolocationOverride","params":{"coordinates":{"latitude":10,"longitude":10,"accuracy":3},"contexts":["052e1ba4-4aad-4560-aa8e-056f21340dd1"]}}
[task 2025-04-09T17:34:14.888Z] 17:34:14     INFO - PID 17304 | 1744220054886	RemoteAgent	TRACE	Received command emulation.setGeolocationOverride for destination ROOT
[task 2025-04-09T17:34:14.893Z] 17:34:14     INFO - PID 17304 | 1744220054891	RemoteAgent	TRACE	Received command _configuration._applySessionData for destination WINDOW_GLOBAL
[task 2025-04-09T17:34:14.897Z] 17:34:14     INFO - PID 17304 | 1744220054895	RemoteAgent	TRACE	Received command _configuration._applySessionData for destination WINDOW_GLOBAL
[task 2025-04-09T17:34:14.915Z] 17:34:14     INFO - PID 17304 | 1744220054910	RemoteAgent	TRACE	Received command emulation._setGeolocationOverride for destination WINDOW_GLOBAL
[task 2025-04-09T17:34:14.917Z] 17:34:14     INFO - PID 17304 | 1744220054912	RemoteAgent	DEBUG	WebDriverBiDiConnection 4e1c5bd8-cd2b-453e-9b3c-2148770b76f0 <- {"type":"success","id":75,"result":{}}
[task 2025-04-09T17:34:14.934Z] 17:34:14     INFO - PID 17304 | *** WIFI GEO: onStatus called.wifi-timeout
[task 2025-04-09T17:34:14.935Z] 17:34:14     INFO - PID 17304 | *** WIFI GEO: Use request cache:true reason:New req. is GeoIP.
[task 2025-04-09T17:34:14.941Z] 17:34:14     INFO - PID 17304 | 1744220054934	RemoteAgent	DEBUG	WebDriverBiDiConnection 4e1c5bd8-cd2b-453e-9b3c-2148770b76f0 <- {"type":"event","method":"script.message","params":{"channel":"channel_name","data":{"type":"object","value":[["latitude",{"type":"number","value":10}],["longitude",{"type":"number","value":10}],["altitude",{"type":"null"}],["accuracy",{"type":"number","value":3}],["altitudeAccuracy",{"type":"null"}],["heading",{"type":"null"}],["speed",{"type":"null"}]]},"source":{"realm":"27f8c258-33be-41a5-9a9f-6c25b8da9f0b","context":"052e1ba4-4aad-4560-aa8e-056f21340dd1"}}}
[task 2025-04-09T17:34:14.964Z] 17:34:14     INFO - PID 17304 | 1744220054962	RemoteAgent	DEBUG	WebDriverBiDiConnection 4e1c5bd8-cd2b-453e-9b3c-2148770b76f0 <- {"type":"event","method":"script.message","params":{"channel":"channel_name","data":{"type":"object","value":[["latitude",{"type":"number","value":37.41857}],["longitude",{"type":"number","value":-122.08769}],["altitude",{"type":"null"}],["accuracy",{"type":"number","value":42}],["altitudeAccuracy",{"type":"null"}],["heading",{"type":"null"}],["speed",{"type":"null"}]]},"source":{"realm":"27f8c258-33be-41a5-9a9f-6c25b8da9f0b","context":"052e1ba4-4aad-4560-aa8e-056f21340dd1"}}}

It might be an issue with my platform patch, we set now two services: override and original, and maybe in case of watching it manages to send it to the original as well. But I couldn't reproduce it so far. Let's observe for a bit and see how frequent is going to be.

You need to log in before you can comment on or make changes to this bug.