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

Browser and test freeze in headless mode #1388

Open
volnyansky opened this issue Jun 17, 2024 · 1 comment
Open

Browser and test freeze in headless mode #1388

volnyansky opened this issue Jun 17, 2024 · 1 comment
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

Comments

@volnyansky
Copy link

volnyansky commented Jun 17, 2024

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.

@volnyansky volnyansky added the bug Something isn't working label Jun 17, 2024
@volnyansky
Copy link
Author

volnyansky commented Jun 17, 2024

Read more about new headless https://developer.chrome.com/docs/chromium/new-headless

@inancgumus inancgumus added next Might be eligible for the next planning (not guaranteed!) user request Requested by the community stability runtime stability improvements labels Jun 20, 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 next Might be eligible for the next planning (not guaranteed!) stability runtime stability improvements user request Requested by the community
Projects
None yet
Development

No branches or pull requests

2 participants