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

K6 process doesn't terminates after completing its execution #4080

Open
aupadhyay-coursera opened this issue Nov 28, 2024 · 3 comments
Open
Assignees

Comments

@aupadhyay-coursera
Copy link

Brief summary

I am running K6 on an AWS Fargate cluster via a Jenkins pipeline. I have noticed that, more often than not, the K6 process does not terminate keeps on running even after running all the iterations. This issue halts the execution on the agent and prevents the agent from progressing to the next stage in the pipeline.

k6 version

0.53.0

OS

Arch Linux

Docker version and image (if applicable)

No response

Steps to reproduce the problem

  1. Utilizing K6 to execute browser load tests on an AWS Fargate Cluster with a configuration of 16 vCPUs and 32 GB RAM per agent, supporting 10 VUs (Virtual Users) per agent.
  2. Conducting UI load testing with the above configuration across 100 agents simultaneously.

Image

Expected behaviour

It Should move to next stage.

Actual behaviour

It keeps the agent in the same phase without exiting succesfully.

@olegbespalov
Copy link
Contributor

Hi @aupadhyay-coursera !

To be able to figure out what and why is happening there, we need more details/context.

Would it be possible to share your script without revealing your business insights? Which output/configurations do you use? Would it be possible to increase verbosity (-v) and collect more logs?

@aupadhyay-coursera
Copy link
Author

aupadhyay-coursera commented Nov 28, 2024

Output configuration:

K6_WEB_DASHBOARD=true K6_WEB_DASHBOARD_EXPORT=html-report.html K6_BROWSER_ARGS='no-sandbox,use-gl=swiftshader,disable-web-security,enable-unsafe-swiftshader,disable-webgl,disable-dev-shm-usage,ignore-certificate-errors' K6_BROWSER_HEADLESS=false k6 run .js

Here is test snippets

const startIndex = parseInt(__ENV.START_INDEX) || 0;
const endIndex = parseInt(__ENV.END_INDEX) || loginAccounts.length;

const assignedAccounts = loginAccounts.slice(startIndex, endIndex);
const iterationsPassed = new Counter('iterations_passed');
const iterationsFailed = new Counter('iterations_failed');


export const options = {
  scenarios: {
    ui: {
      executor: 'per-vu-iterations',
      vus: assignedAccounts.length, // Number of VUs is equal to the number of users
      iterations: 1, // Each user runs once
      maxDuration: '10m', // Max duration
      options: {
        browser: {
          type: 'chromium',
        },
      },
    },
  },
};

export default async function () {
  const user = assignedAccounts[__VU - 1];

/**
 * Performing user operations here
*/

 // Increment the passed iterations counter
    iterationsPassed.add(1);
  } 
  catch (error) {
    console.error(`Test failed for user ${user.email} at operation :`, error.message);
    iterationsFailed.add(1);
    await page.screenshot({ path: `screenshot.png` }); 
  } finally {
    await page.close();
  }
}

export function handleSummary(data) {
  return {
    'summary.json': JSON.stringify(data), //the default data object
  };
}

@olegbespalov
Copy link
Contributor

Okay, so the script uses the browser module, and it's k6 v0.53.

I believe we saw such issues and there were a couple of fixes, that landed in recent k6 versions:

Please try running the latest k6 v0.55 and see if the issue remains there.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants