K6 browsers more than 1 vus

I try to run more than 1 vus, but whenrver I try to add something to commandline this show up:

PS C:\dist\fido2-performance-test> where.exe chrome.exe
C:\Program Files\Google\Chrome Beta\Application\chrome.exe
PS C:\dist\fido2-performance-test> k6 run .\userportal-login-logout.js --vus 1 --duration 1m
PS C:\dist\fido2-performance-test> k6 run .\userportal-login-logout.js --vus 1 --duration 1m

         /\      Grafana   /‾‾/
    /\  /  \     |\  __   /  /
   /  \/    \    | |/ /  /   ‾‾\
  /          \   |   (  |  (‾)  |
 / __________ \  |_|\_\  \_____/

     execution: local
        script: .\userportal-login-logout.js
        output: -

     scenarios: (100.00%) 1 scenario, 1 max VUs, 1m30s max duration (incl. graceful stop):
              * default: 1 looping VUs for 1m0s (gracefulStop: 30s)

ERRO[0000] Uncaught (in promise) browser not found in registry. make sure to set browser type option in scenario definition in order to use the browser module  executor=constant-vus scenario=default
ERRO[0000] Uncaught (in promise) browser not found in registry. make sure to set browser type option in scenario definition in order to use the browser module  executor=constant-vus scenario=default
ERRO[0000] Uncaught (in promise) browser not found in registry. make sure to set browser type option in scenario definition in order to use the browser module  executor=constant-vus scenario=default
ERRO[0000] Uncaught (in promise) browser not found in registry. make sure to set browser type option in scenario definition in order to use the browser module  executor=constant-vus scenario=default
ERRO[0000] Uncaught (in promise) browser not found in registry. make sure to set browser type option in scenario definition in order to use the browser module  executor=constant-vus scenario=default
ERRO[0000] Uncaught (in promise) browser not found in registry. make sure to set browser type option in scenario definition in order to use the browser module  executor=constant-vus scenario=default
ERRO[0000] Uncaught (in promise) browser not found in registry. make sure to set browser type option in scenario definition in order to use the browser module  executor=constant-vus scenario=default
ERRO[0000] Uncaught (in promise) browser not found in registry. make sure to set browser type option in scenario definition in order to use the browser module  executor=constant-vus scenario=default

without parameters it starts:

k6 run .\userportal-login-logout.js

         /\      Grafana   /‾‾/
    /\  /  \     |\  __   /  /
   /  \/    \    | |/ /  /   ‾‾\
  /          \   |   (  |  (‾)  |
 / __________ \  |_|\_\  \_____/

     execution: local
        script: .\userportal-login-logout.js
        output: -

     scenarios: (100.00%) 1 scenario, 1 max VUs, 10m30s max duration (incl. graceful stop):
              * ui: 1 iterations shared among 1 VUs (maxDuration: 10m0s, gracefulStop: 30s)

INFO[0004] url:xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx  source=console
INFO[0004] ssn:16856799232                               source=console
:

in my api tests I usually only set via commandline in our CI/CD:

But adding this in the options give this error:

ERRO[0000] using an execution configuration shortcut (`duration`) and `scenarios` simultaneously is not allowed

This does not work:

export const options = {
  scenarios: {
    ui: {
      executor: 'shared-iterations',
      options: {
        browser: {
          type: 'chromium',
          headless: false,
        },
      },
    },
  },
  vus: 60,
  duration: '120s'
};

Found something in the bugs: Browser hangs once the test completes · Issue #1446 · grafana/xk6-browser · GitHub

export const options = {
  scenarios: {
    ui: {
      executor: 'constant-vus',
      vus: 10,
      duration: '120s',
      options: {
        browser: {
          type: 'chromium',
          headless: false,
        },
      },
    },
  },

I manage a 5x speedup on 10vus, not that bad on the same node

1 Like

Hi @mortenb123,

Could you please add your findings to the Github issue? That will help us when working on a solution.

Thanks!

Sorry, a but unclear it was the config used in that bug that fixed it for me, there is no documentation of the option constant-vus on Browser options | Grafana k6 documentation, which was the one I got to work.

1 Like