Closed Bug 1796201 Opened 3 years ago Closed 2 years ago

Intermittent /webdriver/tests/bidi/script/evaluate/evaluate.py | test_different_target_realm - webdriver.bidi.error.UnknownErrorException: unknown error (TypeError: realm is null)

Categories

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

defect

Tracking

(Not tracked)

RESOLVED WORKSFORME

People

(Reporter: intermittent-bug-filer, Unassigned)

References

Details

(Keywords: intermittent-failure)

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


[task 2022-10-19T15:51:09.204Z] 15:51:09     INFO - STDOUT: _________________________ test_different_target_realm __________________________
[task 2022-10-19T15:51:09.205Z] 15:51:09     INFO - PID 2125 | 1666194669200	mozdevice	TRACE	execute_host_command: << []
[task 2022-10-19T15:51:09.205Z] 15:51:09     INFO - PID 2125 | 1666194669200	mozdevice	TRACE	execute_host_command: >> "host-serial:emulator-5554:killforward:tcp:9222"
[task 2022-10-19T15:51:09.205Z] 15:51:09     INFO - PID 2125 | 1666194669200	mozdevice	TRACE	execute_host_command: << ""
[task 2022-10-19T15:51:09.206Z] 15:51:09     INFO - PID 2125 | 1666194669200	geckodriver::android	DEBUG	WebSocket port forward (9222 -> 9222) stopped
[task 2022-10-19T15:51:09.206Z] 15:51:09     INFO - PID 2125 | 1666194669200	webdriver::server	DEBUG	<- 200 OK {"value":null}
[task 2022-10-19T15:51:09.207Z] 15:51:09     INFO - STDOUT: bidi_session = <webdriver.bidi.client.BidiSession object at 0x7fc21c0b1470>
[task 2022-10-19T15:51:09.207Z] 15:51:09     INFO - STDOUT:     @pytest.mark.asyncio
[task 2022-10-19T15:51:09.208Z] 15:51:09     INFO - STDOUT:     async def test_different_target_realm(bidi_session):
[task 2022-10-19T15:51:09.209Z] 15:51:09     INFO - STDOUT:         await bidi_session.browsing_context.create(type_hint="tab")
[task 2022-10-19T15:51:09.209Z] 15:51:09     INFO - STDOUT:     
[task 2022-10-19T15:51:09.210Z] 15:51:09     INFO - STDOUT:         realms = await bidi_session.script.get_realms()
[task 2022-10-19T15:51:09.215Z] 15:51:09     INFO - 
[task 2022-10-19T15:51:09.215Z] 15:51:09     INFO - TEST-PASS | /webdriver/tests/bidi/script/evaluate/evaluate.py | test_eval 
[task 2022-10-19T15:51:09.215Z] 15:51:09     INFO - TEST-PASS | /webdriver/tests/bidi/script/evaluate/evaluate.py | test_interact_with_dom 
[task 2022-10-19T15:51:09.215Z] 15:51:09     INFO - TEST-PASS | /webdriver/tests/bidi/script/evaluate/evaluate.py | test_target_realm 
[task 2022-10-19T15:51:09.215Z] 15:51:09     INFO - TEST-UNEXPECTED-FAIL | /webdriver/tests/bidi/script/evaluate/evaluate.py | test_different_target_realm - webdriver.bidi.error.UnknownErrorException: unknown error (TypeError: realm is null)
[task 2022-10-19T15:51:09.215Z] 15:51:09     INFO - bidi_session = <webdriver.bidi.client.BidiSession object at 0x7fc21c0b1470>
[task 2022-10-19T15:51:09.215Z] 15:51:09     INFO - 
[task 2022-10-19T15:51:09.215Z] 15:51:09     INFO -     @pytest.mark.asyncio
[task 2022-10-19T15:51:09.215Z] 15:51:09     INFO -     async def test_different_target_realm(bidi_session):
[task 2022-10-19T15:51:09.215Z] 15:51:09     INFO -         await bidi_session.browsing_context.create(type_hint="tab")
[task 2022-10-19T15:51:09.215Z] 15:51:09     INFO -     
[task 2022-10-19T15:51:09.215Z] 15:51:09     INFO -         realms = await bidi_session.script.get_realms()
[task 2022-10-19T15:51:09.215Z] 15:51:09     INFO -         first_tab_default_realm = realms[0]["realm"]
[task 2022-10-19T15:51:09.215Z] 15:51:09     INFO -         second_tab_default_realm = realms[1]["realm"]
[task 2022-10-19T15:51:09.215Z] 15:51:09     INFO -     
[task 2022-10-19T15:51:09.215Z] 15:51:09     INFO -         assert first_tab_default_realm != second_tab_default_realm
[task 2022-10-19T15:51:09.215Z] 15:51:09     INFO -     
[task 2022-10-19T15:51:09.215Z] 15:51:09     INFO -         await bidi_session.script.evaluate(
[task 2022-10-19T15:51:09.215Z] 15:51:09     INFO -             raw_result=True,
[task 2022-10-19T15:51:09.216Z] 15:51:09     INFO -             expression="window.foo = 3",
[task 2022-10-19T15:51:09.216Z] 15:51:09     INFO -             target=RealmTarget(first_tab_default_realm),
[task 2022-10-19T15:51:09.216Z] 15:51:09     INFO -             await_promise=True,
[task 2022-10-19T15:51:09.216Z] 15:51:09     INFO -         )
[task 2022-10-19T15:51:09.216Z] 15:51:09     INFO -         await bidi_session.script.evaluate(
[task 2022-10-19T15:51:09.216Z] 15:51:09     INFO -             raw_result=True,
[task 2022-10-19T15:51:09.216Z] 15:51:09     INFO -             expression="window.foo = 5",
[task 2022-10-19T15:51:09.216Z] 15:51:09     INFO -             target=RealmTarget(second_tab_default_realm),
[task 2022-10-19T15:51:09.216Z] 15:51:09     INFO - >           await_promise=True,
[task 2022-10-19T15:51:09.216Z] 15:51:09     INFO -         )
[task 2022-10-19T15:51:09.216Z] 15:51:09     INFO - 
[task 2022-10-19T15:51:09.216Z] 15:51:09     INFO - bidi_session = <webdriver.bidi.client.BidiSession object at 0x7fc21c0b1470>
[task 2022-10-19T15:51:09.216Z] 15:51:09     INFO - first_tab_default_realm = '3f019292-ad11-4443-8088-b0806385edce'
[task 2022-10-19T15:51:09.216Z] 15:51:09     INFO - realms     = [{'context': 'c096af8d-264c-46d1-bb93-47507673a396',
[task 2022-10-19T15:51:09.216Z] 15:51:09     INFO -   'origin': 'null',
[task 2022-10-19T15:51:09.216Z] 15:51:09     INFO -   'realm': '3f019292-ad11-4443-8088-b0806385edce',
[task 2022-10-19T15:51:09.216Z] 15:51:09     INFO -   'sandbox': None,
[task 2022-10-19T15:51:09.216Z] 15:51:09     INFO -   'type': 'window'},
[task 2022-10-19T15:51:09.216Z] 15:51:09     INFO -  {'context': 'dec74289-d650-4a97-89dc-dad68da4141c',
[task 2022-10-19T15:51:09.216Z] 15:51:09     INFO -   'origin': 'null',
[task 2022-10-19T15:51:09.216Z] 15:51:09     INFO -   'realm': 'e24a9d2e-651a-451d-a7e5-e51a5fc90ec3',
[task 2022-10-19T15:51:09.216Z] 15:51:09     INFO -   'sandbox': None,
[task 2022-10-19T15:51:09.216Z] 15:51:09     INFO -   'type': 'window'}]
[task 2022-10-19T15:51:09.216Z] 15:51:09     INFO - second_tab_default_realm = 'e24a9d2e-651a-451d-a7e5-e51a5fc90ec3'
[task 2022-10-19T15:51:09.216Z] 15:51:09     INFO - 
[task 2022-10-19T15:51:09.216Z] 15:51:09     INFO - tests/web-platform/tests/webdriver/tests/bidi/script/evaluate/evaluate.py:74: 
[task 2022-10-19T15:51:09.216Z] 15:51:09     INFO - _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
[task 2022-10-19T15:51:09.216Z] 15:51:09     INFO - 
[task 2022-10-19T15:51:09.216Z] 15:51:09     INFO - self = <webdriver.bidi.modules.script.Script object at 0x7fc21c1163c8>
[task 2022-10-19T15:51:09.216Z] 15:51:09     INFO - kwargs = {'await_promise': True, 'expression': 'window.foo = 5', 'target': {'realm': 'e24a9d2e-651a-451d-a7e5-e51a5fc90ec3'}}
[task 2022-10-19T15:51:09.216Z] 15:51:09     INFO - raw_result = True
[task 2022-10-19T15:51:09.216Z] 15:51:09     INFO - params = {'awaitPromise': True, 'expression': 'window.foo = 5', 'target': {'realm': 'e24a9d2e-651a-451d-a7e5-e51a5fc90ec3'}}
[task 2022-10-19T15:51:09.216Z] 15:51:09     INFO - mod_name = 'script', cmd_name = 'script.evaluate'
[task 2022-10-19T15:51:09.216Z] 15:51:09     INFO - future = <Future finished exception=UnknownErrorException(unknown error, TypeError: realm is null, #getRealmInfos/<@chrome://re...es/root/script.sys.mjs:501:9
[task 2022-10-19T15:51:09.216Z] 15:51:09     INFO - #getRealmInfos@chrome://remote/content/webdriver-bidi/modules/root/script.sys.mjs:499:8
[task 2022-10-19T15:51:09.216Z] 15:51:09     INFO - )>
[task 2022-10-19T15:51:09.216Z] 15:51:09     INFO - 
[task 2022-10-19T15:51:09.216Z] 15:51:09     INFO -     @functools.wraps(params_fn)
[task 2022-10-19T15:51:09.216Z] 15:51:09     INFO -     async def inner(self: Any, **kwargs: Any) -> Any:
[task 2022-10-19T15:51:09.216Z] 15:51:09     INFO -         raw_result = kwargs.pop("raw_result", False)
[task 2022-10-19T15:51:09.216Z] 15:51:09     INFO -         params = params_fn(self, **kwargs)
[task 2022-10-19T15:51:09.216Z] 15:51:09     INFO -     
[task 2022-10-19T15:51:09.216Z] 15:51:09     INFO -         # Convert the classname and the method name to a bidi command name
[task 2022-10-19T15:51:09.216Z] 15:51:09     INFO -         mod_name = owner.__name__[0].lower() + owner.__name__[1:]
[task 2022-10-19T15:51:09.216Z] 15:51:09     INFO -         if hasattr(owner, "prefix"):
[task 2022-10-19T15:51:09.216Z] 15:51:09     INFO -             mod_name = f"{owner.prefix}:{mod_name}"
[task 2022-10-19T15:51:09.216Z] 15:51:09     INFO -         cmd_name = f"{mod_name}.{to_camelcase(name)}"
[task 2022-10-19T15:51:09.217Z] 15:51:09     INFO -     
[task 2022-10-19T15:51:09.217Z] 15:51:09     INFO -         future = await self.session.send_command(cmd_name, params)
[task 2022-10-19T15:51:09.217Z] 15:51:09     INFO - >       result = await future
[task 2022-10-19T15:51:09.217Z] 15:51:09     INFO - E       webdriver.bidi.error.UnknownErrorException: unknown error (TypeError: realm is null)
[task 2022-10-19T15:51:09.217Z] 15:51:09     INFO - E       
[task 2022-10-19T15:51:09.217Z] 15:51:09     INFO - E       Remote-end stacktrace:
[task 2022-10-19T15:51:09.217Z] 15:51:09     INFO - E       
[task 2022-10-19T15:51:09.217Z] 15:51:09     INFO - E       #getRealmInfos/<@chrome://remote/content/webdriver-bidi/modules/root/script.sys.mjs:501:9
[task 2022-10-19T15:51:09.217Z] 15:51:09     INFO - E       #getRealmInfos@chrome://remote/content/webdriver-bidi/modules/root/script.sys.mjs:499:8
[task 2022-10-19T15:51:09.217Z] 15:51:09     INFO - 
[task 2022-10-19T15:51:09.217Z] 15:51:09     INFO - cmd_name   = 'script.evaluate'
[task 2022-10-19T15:51:09.217Z] 15:51:09     INFO - future     = <Future finished exception=UnknownErrorException(unknown error, TypeError: realm is null, #getRealmInfos/<@chrome://remote/content/webdriver-bidi/modules/root/script.sys.mjs:501:9
[task 2022-10-19T15:51:09.217Z] 15:51:09     INFO - #getRealmInfos@chrome://remote/content/webdriver-bidi/modules/root/script.sys.mjs:499:8
[task 2022-10-19T15:51:09.217Z] 15:51:09     INFO - )>
[task 2022-10-19T15:51:09.217Z] 15:51:09     INFO - kwargs     = {'await_promise': True,
[task 2022-10-19T15:51:09.217Z] 15:51:09     INFO -  'expression': 'window.foo = 5',
[task 2022-10-19T15:51:09.217Z] 15:51:09     INFO -  'target': {'realm': 'e24a9d2e-651a-451d-a7e5-e51a5fc90ec3'}}
[task 2022-10-19T15:51:09.217Z] 15:51:09     INFO - mod_name   = 'script'
[task 2022-10-19T15:51:09.217Z] 15:51:09     INFO - name       = 'evaluate'
[task 2022-10-19T15:51:09.217Z] 15:51:09     INFO - owner      = <class 'webdriver.bidi.modules.script.Script'>
[task 2022-10-19T15:51:09.217Z] 15:51:09     INFO - params     = {'awaitPromise': True,
[task 2022-10-19T15:51:09.217Z] 15:51:09     INFO -  'expression': 'window.foo = 5',
[task 2022-10-19T15:51:09.217Z] 15:51:09     INFO -  'target': {'realm': 'e24a9d2e-651a-451d-a7e5-e51a5fc90ec3'}}
[task 2022-10-19T15:51:09.217Z] 15:51:09     INFO - params_fn  = <function Script.evaluate at 0x7fc21d9601e0>
[task 2022-10-19T15:51:09.217Z] 15:51:09     INFO - raw_result = True
[task 2022-10-19T15:51:09.217Z] 15:51:09     INFO - result_fn  = <function Script._evaluate at 0x7fc21d960268>
[task 2022-10-19T15:51:09.217Z] 15:51:09     INFO - self       = <webdriver.bidi.modules.script.Script object at 0x7fc21c1163c8>
[task 2022-10-19T15:51:09.217Z] 15:51:09     INFO - 
[task 2022-10-19T15:51:09.217Z] 15:51:09     INFO - tests/web-platform/tests/tools/webdriver/webdriver/bidi/modules/_module.py:73: UnknownErrorException
[task 2022-10-19T15:51:09.218Z] 15:51:09     INFO - TEST-OK | /webdriver/tests/bidi/script/evaluate/evaluate.py | took 5628ms

That's an interesting failure that happens here:
https://searchfox.org/mozilla-central/rev/88f285c5163f73abd209d4f73cfa476660351982/remote/webdriver-bidi/modules/root/script.sys.mjs#501

We map over a list of realms and as such I would expect that realm is a valid Realm object. So why does accessing realm.context cause unknown error (TypeError: realm is null)?

Lets see if that happens again.

Duplicate of this bug: 1798004
Status: NEW → RESOLVED
Closed: 3 years ago
Resolution: --- → INCOMPLETE
Status: RESOLVED → REOPENED
Resolution: INCOMPLETE → ---
Status: REOPENED → RESOLVED
Closed: 3 years ago2 years ago
Resolution: --- → INCOMPLETE
Status: RESOLVED → REOPENED
Resolution: INCOMPLETE → ---

We have a [16] ProgressListener No navigation detected: about:blank right before the failure, so let's block this on Bug 1832891 as well.

Depends on: 1832891

Just a single failure this week. Lets wait with closing this bug until Monday next week.

No longer depends on: 1832891
No longer depends on: 1838382

This failure is potentially fixed by bug 1838382. Given that I'm unclear I'm going to mark the bug as WFM.

Status: REOPENED → RESOLVED
Closed: 2 years ago2 years ago
Resolution: --- → WORKSFORME
You need to log in before you can comment on or make changes to this bug.