Closed ka3de closed 1 year ago
Hi,
First of all, great working narrowing down the cause.
Second, I see there is an orphaned PR for this, any idea if this fix can make it into the next version as it is blocking our large scale performance testing.
Thanks so much!
@ArielKo1248,
We're going to add this to our current milestone.
Hi @ArielKo1248 , the fix for this issue has just been merged into main
, but won't be included in k6 until the next release. If you want you can use xk6 to build a custom version which includes k6 browser main
version.
Brief summary
There is a mishandling of
RemoteObject
parsing when this one is of subtypenull
. This mishandling ends up on our implementation trying to unmarshal anil
value which ultimately results in a panic with error:The concrete flow is the following:
parseRemoteObject
method is called with acdpruntime.RemoteObject
with subtypenull
andobj.UnserializableValue
=""
See example of received data:UnserializableValue
=""
the call is made toparseRemoteObjectValue
.TypeObject
, but becauseObjectPreview
isnil
andval
!=Object
, execution goes to the end of the function, where the value (nil
in this case) will be attempted to be serialized, resulting the mentioned error.Solution We should add an explicit case inside
TypeObject
case in order to handlenull
subtype.See the CDP specs for remote object and possible values for
type
andsubtype
.xk6-browser version
v0.8.1
OS
Ubuntu 20.04.5 LTS
Chrome version
109.0.5414.119 (Official Build) (64-bit)
Docker version and image (if applicable)
No response
Steps to reproduce the problem
The problem can be reproduced with this script:
Expected behaviour
The xk6-browser execution finishes correctly, navigating to the website.
Actual behaviour
The execution crashes with the following error:
See also the comparison between the console log messages in the k6 output vs the console.log message shown when navigating to the website through the browser:
Notice the
null
messages output in the browser console right at the moment that xk6-browser crashes.Related: https://github.com/grafana/xk6-browser/issues/777