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

Panic on EventFrameRequestedNavigation with stale frame #1546

Open
2 tasks done
ankur22 opened this issue Nov 22, 2024 · 0 comments
Open
2 tasks done

Panic on EventFrameRequestedNavigation with stale frame #1546

ankur22 opened this issue Nov 22, 2024 · 0 comments
Assignees
Labels
bug Something isn't working

Comments

@ankur22
Copy link
Collaborator

ankur22 commented Nov 22, 2024

Brief summary

When we get a EventFrameRequestedNavigation CDP event from chrome, it might be associated to a stale frame that no longer exists in memory. This is the stack trace that we see:

panic: GoError: handling frameRequestedNavigation event to "https://...": no frame exists with ID DB9E6F291E31070542D4EDD570CBC4E3

goroutine 101631 [running]:
go.k6.io/k6/js/common.Throw(...)
go.k6.io/k6/js/common/util.go:17
github.com/grafana/xk6-browser/k6ext.Panic.func1(0xc000360c08, {0xc003aaf5e0?, 0x1f79dd8?, 0xc003f75d01?})
github.com/grafana/[email protected]/k6ext/panic.go:35 +0x74
github.com/grafana/xk6-browser/k6ext.sharedPanic({0x1f9ad08, 0xc000688d70}, 0xc004120da8, {0xc003aaf5e0, 0x2, 0x2})
github.com/grafana/[email protected]/k6ext/panic.go:64 +0x274
github.com/grafana/xk6-browser/k6ext.Panic({0x1f9ad08?, 0xc000688d70?}, {0x1c7d0e7?, 0xc0038033b0?}, {0xc003aaf5e0?, 0x0?, 0x0?})
github.com/grafana/[email protected]/k6ext/panic.go:37 +0x4b
github.com/grafana/xk6-browser/common.(*FrameSession).onFrameRequestedNavigation(0xc00408fc80, 0xc003fb13c0)
github.com/grafana/[email protected]/common/frame_session.go:867 +0x285
github.com/grafana/xk6-browser/common.(*FrameSession).initEvents.func1()
github.com/grafana/[email protected]/common/frame_session.go:283 +0x773
created by github.com/grafana/xk6-browser/common.(*FrameSession).initEvents in goroutine 528
github.com/grafana/[email protected]/common/frame_session.go:239 +0x19b

The fix is to not return an error from frameRequestedNavigation when frame == nil, and instead just return nil (no error).

It's the same in PW (1 -> 2).

xk6-browser version

v1.9.1

OS

NA

Chrome version

NA

Docker version and image (if applicable)

No response

Steps to reproduce the problem

Expected behaviour

Actual behaviour

Tasks

Preview Give feedback
@ankur22 ankur22 added the bug Something isn't working label Nov 22, 2024
@ankur22 ankur22 self-assigned this Nov 22, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant