Quantcast
Channel: Grafana k6 - Grafana Labs Community Forums
Viewing all articles
Browse latest Browse all 346

Error when running basic script with k6 browser

$
0
0

Hi,

I’ve experimented with k6 scripts and I was getting these errors :

ERRO[0063] cleaning up the user data directory: remove my-computer\AppData\Local\Temp\k6browser-data-1697464291\lockfile: The process cannot access the file because it is being used by another process. category=“Browser:Close” elapsed=“4490 ms” source=browser

ERRO[0066] process with PID 42648 unexpectedly ended: exit status 1 category=browser elapsed=“34640 ms” source=browser

So I was curious to run your basic test in your documentation and i’m encountering the same problems when running and adding iterations or vus in your basic script.
I’m using k6 version 0.58 on Windows 11.

import { browser } from 'k6/browser';

export const options = {
  scenarios: {
    ui: {
      executor: 'shared-iterations',
      vus: 1,
      iterations: 10,
      options: {
        browser: {
          type: 'chromium',
        },
      },
    },
  },
  thresholds: DEFAULT_THRESHOLDS,
};

export default async function () {
  const page = await browser.newPage();

  try {
    await page.goto('https://test.k6.io/');
    await page.screenshot({ path: 'screenshots/screenshot.png' });
  } finally {
    await page.close();
  }
}

So basically my question is, why do I have these errors ? Do I need to configure something in my workstation ?

Second and last question, i’m wondering if these errors i’m encountering affect the result calculated time (Thresholds) ? I’m asking because i’m testing with basic pages like google or wikipedia, maybe they don’t respect my thresholds but that would be surprising.

FYI these are my thresholds :

export const DEFAULT_THRESHOLDS = {
  browser_web_vital_cls: ['p(95) <= 250'],
  browser_web_vital_lcp: ['p(95) <= 4000'],
  browser_web_vital_fid: ['p(95) <= 300'],
  browser_web_vital_ttfb: ['p(95) <= 1800'],
  browser_web_vital_fcp: ['p(95) <= 3000'],
  browser_web_vital_inp: ['p(95) <= 500'],
  http_req_failed: ['rate<0.01'],
  http_req_duration: ['p(95)<500', 'p(99)<1000'],
};

Thanks in advance for your help !
Eric

1 post - 1 participant

Read full topic


Viewing all articles
Browse latest Browse all 346

Trending Articles