grafana / xk6-browser

k6 extension that adds support for browser automation and end-to-end web testing via the Chrome Devtools Protocol

Home Page:https://grafana.com/docs/k6/latest/javascript-api/k6-experimental/browser/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

`TestK6Object/with_testRunId` fails with cannot find context with specified ID

inancgumus opened this issue · comments

What?

Fix the "cannot find context with specified ID" error in the flaky test (see this failure).

Commit: a3b0093

Message:

--- FAIL: TestBrowserCrashErr (0.11s)
    browser_test.go:241: 
        	Error Trace:	/home/runner/work/xk6-browser/xk6-browser/tests/browser_test.go:241
        	Error:      	Error "error building browser on IterStart: launching browser: browser process ended unexpectedly at <eval>:1:1(0)" does not contain "launching browser: Invalid devtools server port"
        	Test:       	TestBrowserCrashErr
time="2024-05-08T10:20:33Z" level=error msg="process with PID 5654 unexpectedly ended: signal: killed" category=browser elapsed="0 ms" source=browser
time="2024-05-08T10:20:33Z" level=error msg="Failed to load resource: the server responded with a status of 404 (Not Found)" browser_source=network line_number=0 source=browser stacktrace="<nil>" url="http://127.0.0.1:35567/ping"
time="2024-05-08T10:20:33Z" level=error msg="error on evaluating window.k6SpanId: evaluating JS in global context: context canceled" category="FrameSession:onFrameNavigated" elapsed="0 ms" source=browser
time="2024-05-08T10:20:36Z" level=error msg="communicating with browser: websocket: close 1006 (abnormal closure): unexpected EOF" category=cdp elapsed="0 ms" source=browser
time="2024-05-08T10:20:36Z" level=error msg="process with PID 6918 unexpectedly ended: signal: killed" category=browser elapsed="11 ms" source=browser
time="2024-05-08T10:20:38Z" level=error msg="error on evaluating window.k6SpanId: evaluating JS in global context: context canceled" category="FrameSession:onFrameNavigated" elapsed="0 ms" source=browser
time="2024-05-08T10:20:38Z" level=error msg="Failed to load resource: the server responded with a status of 404 (Not Found)" browser_source=network line_number=0 source=browser stacktrace="<nil>" url="http://127.0.0.1:38151/static/empty.html"
time="2024-05-08T10:20:38Z" level=error msg="error on evaluating window.k6SpanId: evaluating JS in global context: context canceled" category="FrameSession:onFrameNavigated" elapsed="0 ms" source=browser
time="2024-05-08T10:20:39Z" level=warning msg="Please call browser.close only once, and do not use the browser after calling close." category="Browser:Close" elapsed="0 ms" source=browser
time="2024-05-08T10:20:46Z" level=error msg="communicating with browser: websocket: close 1006 (abnormal closure): unexpected EOF" category=cdp elapsed="0 ms" source=browser
time="2024-05-08T10:20:46Z" level=error msg="process with PID 10028 unexpectedly ended: signal: killed" category=browser elapsed="2 ms" source=browser
time="2024-05-08T10:20:48Z" level=error msg="error on evaluating window.k6SpanId: evaluating JS in global context: context canceled" category="FrameSession:onFrameNavigated" elapsed="0 ms" source=browser
--- FAIL: TestK6Object (0.00s)
    --- FAIL: TestK6Object/with_testRunId (0.68s)
        browser_context_test.go:667: 
            	Error Trace:	/home/runner/work/xk6-browser/xk6-browser/tests/browser_context_test.go:667
            	Error:      	Received unexpected error:
            	            	Uncaught (in promise) GoError: evaluating JS: Cannot find context with specified id
            	            		at github.com/grafana/xk6-browser/browser.mapPage.func4 (native)
            	            		at <eval>:5:26(14)
            	Test:       	TestK6Object/with_testRunId

Why?

To fix the flakiness. This might also indicate an underlying issue.

How?

No response

Tasks

Tasks

Related PR(s)/Issue(s)

#1144