artilleryio / artillery

The complete load testing platform. Everything you need for production-grade load tests. Serverless & distributed. Load test with Playwright. Load test HTTP APIs, GraphQL, WebSocket, and more. Use any Node.js module.
https://www.artillery.io
Mozilla Public License 2.0
7.94k stars 507 forks source link

AWS Fargate - Playwright: Timeout's on simple test cases #2350

Open schoggobaer opened 10 months ago

schoggobaer commented 10 months ago

I am using fargate to run the test in aws and i experienced timeouts with very simple test cases.

Maybe its connect to the discussion https://github.com/artilleryio/artillery/discussions/2094

Version info:


        ___         __  _ ____
  _____/   |  _____/ /_(_) / /__  _______  __ ___
 /____/ /| | / ___/ __/ / / / _ \/ ___/ / / /____/
/____/ ___ |/ /  / /_/ / / /  __/ /  / /_/ /____/
    /_/  |_/_/   \__/_/_/_/\___/_/   \__  /
                                    /____/

VERSION INFO:

Artillery: 2.0.1
Node.js:   v18.16.0
OS:        darwin
artillery run-fargate --region eu-central-1 ./test.yml -e dev

I expected to see this happen:

it runs through without any timeouts as long my app responds in time.

Instead, this happened:

I get timeouts on a simple button click

Files being used:

// flow.js
async function helloFlow(page, vuContext, events) {

  await page.goto(`${vuContext.vars.target}/`);
  await page.waitForLoadState();
  await page.getByRole('button', {
    name: 'Alle zulassen',
  }).click();

}
# test.yml
config:
  engines:
    playwright:
      launchOptions:
        headless: true
  processor: "./flows.js"
  phases:
    #   - name: single
    #     duration: 1
    #     arrivalCount: 2
    - name: Warm up
      duration: 60
      arrivalRate: 5
      rampTo: 10
  # - name: Ramp up to peak load
  #   duration: 60
  #   arrivalRate: 10
  #   rampTo: 50
  environments:
    local:
      target: "http://localhost:4202"
    dev:
     target: "..."

scenarios:
  - engine: playwright
    testFunction: "helloFlow"

---- update

when i increase the count the test run longer without timouts but at the end it is still happening

artillery run-fargate --region eu-central-1 ./test.yml -e dev --count 16
hassy commented 10 months ago

Hi @schoggobaer 👋 this is likely happening because the Fargate container runs out of resources (CPU/memory). The load phase in your script creates 5 new headless browsers every second (and ramps up to even more over time). I suggest reducing those numbers and increasing count instead to get the same overall number of virtual users. For example:

- duration: 60
  arrivalRate: 1
  rampTo: 2

And use --count 5 instead so that each Fargate worker runs fewer browsers but you still get a similar total number.

schoggobaer commented 10 months ago

Hi @hassy ok i get it, i think ;) . So in my case i tried to figure out how many users i can get without timeouts in one worker concurrently.

This seems to be the limit for my test

 - duration: 1
    arrivalRate: 20
    maxVusers: 20

When i want to have 500 users simultaneously then i have to set --count 25 right?

Thank you for your quick answer.