Error msg="process with PID 68 unexpectedly ended: signal: killed" category=browser elapsed="0 ms" source=browser

Hello,

I am trying to run front end load test with 100 users but it is encountering the following errors

level=error msg=“Uncaught (in promise) waiting for navigation: timed out after 1m0s” executor=constant-vus scenario=ui

level=error msg=“process with PID 68 unexpectedly ended: signal: killed” category=browser elapsed=“0 ms” source=browser

The scenario I want to test involves a user logging in and then remaining idle for 60 minutes. I am attempting to run this with 100 users, but it is failing.

Note: The script works as expected with 10 users, but it fails when the number of users exceeds 10.

Kindly find the script I am using for this scenario and provide a solution.

 import { browser } from 'k6/experimental/browser';
 import { SharedArray } from 'k6/data';
 import { check, sleep } from 'k6';

 import  papaparse  from './testData/papaparse.js';
 
const userNames = new SharedArray('teamManager_users', function () {
       return papaparse.parse(open('./testData/mrUserNames.csv'), { header: true }).data;
 });

 const randomUser = userNames[Math.floor(Math.random() * userNames.length)];
 const mrTeamManagerUser = randomUser.Teammanager_User

 export const options = {
   scenarios: {
     ui: {
       executor: 'constant-vus',
       vus: 100,
       duration: '1h15m',
       options: {
         browser: {
           type: 'chromium',
         },
       },
     },
   },
   thresholds: {
     checks: ['rate==1.0'],
   },
 };
 
export default async function() {
     const page = await browser.newPage();
 
    try{
         await page.goto('https://abcd.com');
         await page.locator('#txtUserID').fill(mrTeamManagerUser)
         await page.locator('#txtPassword').type('@Rules1#')
        const loginButton = page.locator("#sub");
            await Promise.all([page.waitForNavigation({
              timeout: 60000
            }), loginButton.click()]);
 
    await page.waitForSelector('div.content-item.content-field.item-1 h2', { timeout: 10000 });

     const h2Elements = await page.evaluate(() => {
         return Array.from(document.querySelectorAll('h2')).map(el => el.textContent);
     });

 //    console.log('All H2 Texts:', h2Elements);
 
    const worklistText = h2Elements.find(text => text.includes('Worklist for '));
 //    console.log('Extracted Worklist Text:', worklistText);
 
    check(worklistText, {
         'Worklist text is correct': (text) => text !== undefined,
     });

      sleep(3600);
 
        const loginPage = page.locator('#login'); 
         check(loginPage, {
             'Navigated to login page after logout': (el) => el.isVisible(),
         });
 
    } finally {
        await page.close()
     }
 }```

Hi @Niveditha,

Thank for creating the post.

I have been looking into performance issues with k6 and the browser module recently. The details of what I have found so far can be found here, but it requires more investigation to see what the next steps are and where exactly where the bottleneck is.

In your case the behaviour sounds familiar to me. It seems that the test environment that you are running the test on is having a difficult time keeping up with the demands of running a 100 VU test.

I have some questions for you that will help me understand your issue a bit more.

  1. Do you get any errors or timeouts when you run the test with 10 VUs?
  2. Can you describe your test environment?
    1. What’s the specs of the machine(s) that the k6 instance(s) and chromium instance(s) are running on?
    2. What version of k6 are you running?
    3. Is the test environment instrumented so you can keep an eye on the compute resources? E.g. with grafana so that you visualise the CPU/Memory/network load. If yes, what does that look like when you’re running the test?
    4. Is the website under test instrumented so that you can observe its CPU/memory/network load? If yes, what does that look like when you’re running the test?

Best,
Ankur