Closed Bug 1830616 Opened 2 years ago Closed 1 year ago

Intermittent Wd | webdriver.bidi.modules.script.ScriptEvaluateResultException: Script execution failed

Categories

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

defect

Tracking

(firefox116 fixed)

RESOLVED FIXED
116 Branch
Tracking Status
firefox116 --- fixed

People

(Reporter: intermittent-bug-filer, Assigned: whimboo)

References

Details

(Keywords: intermittent-failure)

Filed by: smolnar [at] mozilla.com
Parsed log: https://treeherder.mozilla.org/logviewer?job_id=414163280&repo=try
Full log: https://firefox-ci-tc.services.mozilla.com/api/queue/v1/task/D-N-CdM-RaetcPebSkT8bw/runs/0/artifacts/public/logs/live_backing.log


TEST-PASS | /webdriver/tests/bidi/network/response_completed/response_completed.py | test_response_status[204-No Content] 
[task 2023-04-29T10:54:09.833Z] 10:54:09     INFO - TEST-UNEXPECTED-FAIL | /webdriver/tests/bidi/network/response_completed/response_completed.py | test_response_status[205-Reset Content] - webdriver.bidi.modules.script.ScriptEvaluateResultException: Script execution failed.
[task 2023-04-29T10:54:09.834Z] 10:54:09     INFO - bidi_session = <webdriver.bidi.client.BidiSession object at 0x000002FB62F07DF0>
[task 2023-04-29T10:54:09.834Z] 10:54:09     INFO - wait_for_event = <function wait_for_event.<locals>.wait_for_event at 0x000002FB62F1A670>
[task 2023-04-29T10:54:09.834Z] 10:54:09     INFO - url = <function url.<locals>.url at 0x000002FB62F1A280>
[task 2023-04-29T10:54:09.834Z] 10:54:09     INFO - fetch = <function fetch.<locals>.fetch at 0x000002FB62F1A1F0>
[task 2023-04-29T10:54:09.834Z] 10:54:09     INFO - setup_network_test = <function setup_network_test.<locals>._setup_network_test at 0x000002FB62E32700>
[task 2023-04-29T10:54:09.834Z] 10:54:09     INFO - status = 205, status_text = 'Reset Content'
[task 2023-04-29T10:54:09.834Z] 10:54:09     INFO - 
[task 2023-04-29T10:54:09.834Z] 10:54:09     INFO -     @pytest.mark.parametrize(
[task 2023-04-29T10:54:09.834Z] 10:54:09     INFO -         "status, status_text",
[task 2023-04-29T10:54:09.834Z] 10:54:09     INFO -         HTTP_STATUS_AND_STATUS_TEXT,
[task 2023-04-29T10:54:09.834Z] 10:54:09     INFO -     )
[task 2023-04-29T10:54:09.834Z] 10:54:09     INFO -     @pytest.mark.asyncio
[task 2023-04-29T10:54:09.834Z] 10:54:09     INFO -     async def test_response_status(
[task 2023-04-29T10:54:09.834Z] 10:54:09     INFO -         bidi_session, wait_for_event, url, fetch, setup_network_test, status, status_text
[task 2023-04-29T10:54:09.834Z] 10:54:09     INFO -     ):
[task 2023-04-29T10:54:09.834Z] 10:54:09     INFO -         status_url = url(
[task 2023-04-29T10:54:09.834Z] 10:54:09     INFO -             f"/webdriver/tests/support/http_handlers/status.py?status={status}&nocache={RESPONSE_COMPLETED_EVENT}"
[task 2023-04-29T10:54:09.835Z] 10:54:09     INFO -         )
[task 2023-04-29T10:54:09.835Z] 10:54:09     INFO -     
[task 2023-04-29T10:54:09.835Z] 10:54:09     INFO -         network_events = await setup_network_test(events=[RESPONSE_COMPLETED_EVENT])
[task 2023-04-29T10:54:09.835Z] 10:54:09     INFO -         events = network_events[RESPONSE_COMPLETED_EVENT]
[task 2023-04-29T10:54:09.835Z] 10:54:09     INFO -     
[task 2023-04-29T10:54:09.835Z] 10:54:09     INFO -         on_response_completed = wait_for_event(RESPONSE_COMPLETED_EVENT)
[task 2023-04-29T10:54:09.835Z] 10:54:09     INFO - >       await fetch(status_url)
[task 2023-04-29T10:54:09.835Z] 10:54:09     INFO - 
[task 2023-04-29T10:54:09.835Z] 10:54:09     INFO - bidi_session = <webdriver.bidi.client.BidiSession object at 0x000002FB62F07DF0>
[task 2023-04-29T10:54:09.835Z] 10:54:09     INFO - events     = []
[task 2023-04-29T10:54:09.835Z] 10:54:09     INFO - fetch      = <function fetch.<locals>.fetch at 0x000002FB62F1A1F0>
[task 2023-04-29T10:54:09.835Z] 10:54:09     INFO - network_events = {'network.responseCompleted': []}
[task 2023-04-29T10:54:09.835Z] 10:54:09     INFO - on_response_completed = <Future pending>
[task 2023-04-29T10:54:09.835Z] 10:54:09     INFO - setup_network_test = <function setup_network_test.<locals>._setup_network_test at 0x000002FB62E32700>
[task 2023-04-29T10:54:09.835Z] 10:54:09     INFO - status     = 205
[task 2023-04-29T10:54:09.835Z] 10:54:09     INFO - status_text = 'Reset Content'
[task 2023-04-29T10:54:09.835Z] 10:54:09     INFO - status_url = 'http://web-platform.test:8000/webdriver/tests/support/http_handlers/status.py?status=205&nocache=network.responseCompleted'
[task 2023-04-29T10:54:09.835Z] 10:54:09     INFO - url        = <function url.<locals>.url at 0x000002FB62F1A280>
[task 2023-04-29T10:54:09.835Z] 10:54:09     INFO - wait_for_event = <function wait_for_event.<locals>.wait_for_event at 0x000002FB62F1A670>
[task 2023-04-29T10:54:09.835Z] 10:54:09     INFO -
Summary: Intermittent /webdriver/tests/bidi/network/response_completed/response_completed.py | test_response_status[205-Reset Content] - webdriver.bidi.modules.script.ScriptEvaluateResultException: Script execution failed. → Intermittent /webdriver/tests/bidi/network/response_completed/response_completed.py | test_response_status[<random>] - webdriver.bidi.modules.script.ScriptEvaluateResultException: Script execution failed.

The failures here are coming from:

[task 2023-04-29T10:53:53.737Z] 10:53:53     INFO - PID 8760 | 1682765633735	RemoteAgent	DEBUG	WebDriverBiDiConnection ca05930e-2dfa-4962-9e2d-5d675c9c8582 -> {"id":61,"method":"script.evaluate","params":{"expression":"\n                 {\n                   const controller = new AbortController();\n                   setTimeout(() => controll ...   \n                     signal: controller.signal\n                   }).then(response => response.text());\n                 }","target":{"context":"5fe9e925-8f06-457a-87a8-3a7e0625d793"},"awaitPromise":true}}
[task 2023-04-29T10:53:53.738Z] 10:53:53     INFO - PID 8760 | 1682765633735	RemoteAgent	TRACE	Received command script.evaluate for destination ROOT
[task 2023-04-29T10:53:53.739Z] 10:53:53     INFO - PID 8760 | 1682765633736	RemoteAgent	TRACE	Received command script.evaluateExpression for destination WINDOW_GLOBAL
[task 2023-04-29T10:53:53.739Z] 10:53:53     INFO - PID 8760 | 1682765633736	RemoteAgent	TRACE	Module windowglobal/script.jsm found for WINDOW_GLOBAL
[task 2023-04-29T10:53:56.740Z] 10:53:56     INFO - PID 8760 | 1682765636746	RemoteAgent	DEBUG	WebDriverBiDiConnection ca05930e-2dfa-4962-9e2d-5d675c9c8582 <- {"id":61,"result":{"realm":"e889cd22-bab9-41b3-8f4e-715b55d2012c","type":"exception","exceptionDetails":{"columnNumber":22,"exception":{"type":"error"},"lineNumber":8,"stackTrace":{"callFrames":[{"columnNumber":22,"functionName":"","lineNumber":8,"url":"http://web-platform.test:8000/webdriver/tests/bidi/network/support/empty.html"}]},"text":"AbortError: The operation was aborted. "}}}

Julian, I thought we already had a bug about increasing the timeout for the fetch helper but I miss to find it. Do you know?

Flags: needinfo?(jdescottes)

Actually I found bug 1829645.

Depends on: 1829645
Flags: needinfo?(jdescottes)
Summary: Intermittent /webdriver/tests/bidi/network/response_completed/response_completed.py | test_response_status[<random>] - webdriver.bidi.modules.script.ScriptEvaluateResultException: Script execution failed. → Intermittent Wd | webdriver.bidi.modules.script.ScriptEvaluateResultException: Script execution failed
Duplicate of this bug: 1831245
Duplicate of this bug: 1831780
Duplicate of this bug: 1835318

Might be related to bug 1832891 as well.

Depends on: 1832891
Duplicate of this bug: 1833562

So the number of failures have definitely decreased but with bug 1832891 we don't have a complete fix because it only handles cases when we open a new context. You can see that here:
https://treeherder.mozilla.org/logviewer?job_id=418531085&repo=autoland&lineNumber=7702-7706

The problem is that we fail on the very first wait for navigation completed when the WebDriver session gets started:
https://searchfox.org/mozilla-central/rev/2e06f92ba068e32a9a7213ee726e8171f91605c7/remote/marionette/driver.sys.mjs#467-469

(In reply to Julian Descottes [:jdescottes] from bug 1832891 comment #22)

Something which would be useful would be a way to know if a document with isInitialDocument set to true is going to navigate or not. Today we don't know for sure so we have to use the timeout. But if we could know for sure when there will be a load, we could decide whether we wait for a navigation or not and completely remove the timeout.

That comment from the other bug is still interesting for me. I really wonder if there is a way to find out if the page stays on the initial about:blank or if it is going to load a different page afterward. Olli, is there any way to find this out?

Flags: needinfo?(smaug)

There is no way to know that. window.open() (no params) may not load anything, as an example.
Or someone may load something to it later using relevant window's location object or so.

Flags: needinfo?(smaug)
Depends on: 1838381
Depends on: 1838382
No longer depends on: 1832891
No longer depends on: 1838382

(In reply to Olli Pettay [:smaug][bugs@pettay.fi] from comment #15)

There is no way to know that. window.open() (no params) may not load anything, as an example.
Or someone may load something to it later using relevant window's location object or so.

Lets move this discussion to bug 1838381 to have it on the right place.

Duplicate of this bug: 1837775

No more failures since my patch on bug 1838381 landed.

Assignee: nobody → hskupin
Status: NEW → RESOLVED
Closed: 1 year ago
Resolution: --- → FIXED
Target Milestone: --- → 116 Branch
You need to log in before you can comment on or make changes to this bug.