Browser and test freeze in headless mode #1388
Labels
bug
Something isn't working
next
Might be eligible for the next planning (not guaranteed!)
stability
runtime stability improvements
user request
Requested by the community
Brief summary
Browser stop react on request and freezes test after ~ 100s of inactivity ( k6.sleep)
xk6-browser version
1.5.1
OS
mac os 14.5
Chrome version
128.0.6540.0
Docker version and image (if applicable)
No response
Steps to reproduce the problem
I use k6 browser to perform stress tests of complex web app: video/audio streaming, web workers, and web sockets. I noticed if I run sleep for more then 100 sec browser freezes: client disconnects from the backend and if I try to call page/browser methods , then the test freezes it keeps running until I stop it. If I use chromium with UI, then the bug is not reproduced.
I've fixed it by overriding chromium headless param with --headless=new (spied it in pupitter) . Here is the my setup:
` export K6_BROWSER_IGNORE_DEFAULT_ARGS=disable-features,headless
#export K6_BROWSER_LOG=debug
K6_BROWSER_ARGS="disable-features=Translate,AcceptCHFrame,MediaRouter,OptimizationHints,ProcessPerSiteUpToMainFrameThreshold,IsolateSandboxedIframes,no-sandbox,disable-setuid-sandbox,allow-file-access=1,use-fake-device-for-media-stream=1,use-fake-ui-for-media-stream=1,use-file-for-fake-video-capture=./assets/video-001.mjpeg,use-file-for-fake-audio-capture=./assets/audio-001.wav"
if [ "$K6_BROWSER_HEADLESS" = true ]; then
K6_BROWSER_ARGS="headless=new,window-size=1920x1080,$K6_BROWSER_ARGS"
fi
export K6_BROWSER_ARGS=$K6_BROWSER_ARGS`
Expected behaviour
The browser doesn't freeze test.
Actual behaviour
The browser freezes the test.
The text was updated successfully, but these errors were encountered: