You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Currently (v0.9.0 commit 480c0c1) the BrowserType.Launch method accepts a timeout option which is defined in the documentation as:
timeout | string | '30s' | Default timeout to use for various actions and navigation.
But in practice this timeout also behaves as the total test timeout. This is because during the browser initialization process, in BrowserType.allocatehere, a new context with timeout is created, based on the browser.options.timeout. Eventually, this context is passed into the browser process "execution command" here, which in practice will kill the process once the context is Done, which will happen after the set timeout elapses.
This context is also misused when passed into BrowserProcess.handleClosehere during browser process initialization. In this case the BrowserProces.cancel()action does not finish the test, but is still a misleading action based on this context timeout.
import{chromium}from'k6/experimental/browser';import{sleep}from'k6';exportdefaultasyncfunction(){constbrowser=chromium.launch({headless: true,// No timeout set defaults to 30s});constcontext=browser.newContext();constpage=context.newPage();try{sleep(31);}finally{page.close();browser.close();}}
Expected behaviour
The test finishes correctly after ~3s and ~31s respectively.
Actual behaviour
The test finishes with error messages:
ERRO[0004] communicating with browser: websocket: close 1006 (abnormal closure): unexpected EOF category=cdp elapsed="0 ms" goroutine=101
ERRO[0004] process with PID 15009 unexpectedly ended: signal: killed category=browser elapsed="5 ms" goroutine=95
ERRO[0005] Uncaught (in promise) GoError: internal error while removing binding from page: websocket: close 1006 (abnormal closure): unexpected EOF
running at github.com/grafana/xk6-browser/api.Page.Close-fm (native)
default at file:///<path/to/script>/script.js:22:4(29) executor=per-vu-iterations scenario=default
due to the process being killed "by force" when browser timeout finishes.
The text was updated successfully, but these errors were encountered:
Brief summary
Currently (v0.9.0 commit 480c0c1) the
BrowserType.Launch
method accepts atimeout
option which is defined in the documentation as:But in practice this
timeout
also behaves as the total test timeout. This is because during the browser initialization process, inBrowserType.allocate
here, a newcontext
with timeout is created, based on thebrowser.options.timeout
. Eventually, thiscontext
is passed into the browser process "execution command" here, which in practice will kill the process once thecontext
is Done, which will happen after the settimeout
elapses.This
context
is also misused when passed intoBrowserProcess.handleClose
here during browser process initialization. In this case theBrowserProces.cancel()
action does not finish the test, but is still a misleading action based on thiscontext
timeout.xk6-browser version
v0.9.0
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
Execute the following tests:
Expected behaviour
The test finishes correctly after ~3s and ~31s respectively.
Actual behaviour
The test finishes with error messages:
due to the process being killed "by force" when browser timeout finishes.
The text was updated successfully, but these errors were encountered: