Skip to content

Bug? looping over variables seems to break logging #3596

@jcollum-nutrien

Description

@jcollum-nutrien

Version info:

VERSION INFO:

Artillery: 2.0.24
Node.js:   v22.15.1
OS:        darwin

Running this command:

DEBUG=http* npx artillery run tmp/loop-debug-bug.ts

DEBUG=http* npx artillery run tmp/loop-debug.ts

output from loop-debug-bug.ts:

Test run id: tkgd6_dm9f437xxh5frf7kmnfjwm6brmac5_prxn
Phase started: Warm up phase (index: 0, duration: 5s) 13:15:55(-0700)

Phase completed: Warm up phase (index: 0, duration: 5s) 13:16:00(-0700)

Phase started: Ramp up load (index: 1, duration: 5s) 13:16:00(-0700)

Phase completed: Ramp up load (index: 1, duration: 5s) 13:16:05(-0700)

--------------------------------------
Metrics for period to: 13:16:00(-0700) (width: 3.154s)
--------------------------------------

vusers.completed: .............................................................. 10
vusers.created: ................................................................ 10
vusers.created_by_name.0: ...................................................... 10

from loop-debug.ts

Test run id: tngng_drz8e9qqknx9jt8j35qhymdt9qnb7_eztr
Phase started: Warm up phase (index: 0, duration: 5s) 13:17:23(-0700)

⠸ *** GET path /dino
2025-08-27T20:17:24.180Z http:request request start: /dino
⠏ 2025-08-27T20:17:24.670Z http request: {
  "url": "http://asciiart.artillery.io:8080/dino",
  "method": "GET",
  "headers": {
    "user-agent": "Artillery (https://artillery.io)"
  }
}
*** GET path /dino
2025-08-27T20:17:24.670Z http:response {
  "server": "awselb/2.0",
  "date": "Wed, 27 Aug 2025 20:17:24 GMT",
  "content-type": "text/plain; charset=utf-8",
  "content-length": "545",
  "connection": "keep-alive"
}

[... etc]

Expected:

For some reason adding the loop seems to break the log output. I'm doing this to attempt to figure out why a POST (in a different file) isn't working, so I created this as a sample to see where the config starts breaking.

I've spent about an hour with ChatGPT and Claude to try to resolve this and it's still not working. I need to be able to loop over a list of variables, send a POST and log the output from the POST, like I would see with curl (just the basic output).

Files being used:

loop-debug.ts

export const config = {
  target: 'http://asciiart.artillery.io:8080',
  phases: [
    { duration: 5, arrivalRate: 1, rampTo: 5, name: 'Warm up phase' },
    { duration: 5, arrivalRate: 5, rampTo: 10, name: 'Ramp up load' },
    // { duration: 30, arrivalRate: 10, rampTo: 30, name: "Spike phase" },
  ],
  variables: {
    path: ['/dino', '/pony', '/armadillo'],
  },
  plugins: {
    ensure: {
      thresholds: [
        { 'http.response_time.p99': 100 },
        { 'http.response_time.p95': 75 },
      ],
    },
    apdex: { threshold: 100 },
    'metrics-by-endpoint': {},
  },
};

export const scenarios = [
  {
    flow: [
      {
        loop: [
          {
            log: '*** GET path {{ path }}',
          },
          {
            get: {
              // pick one path from variables
              url: '{{ path }}',
            },
          },
        ],
        count: 5,
      },
    ],
  },
];

loop-debug-bug.ts

export const config = {
  target: 'http://asciiart.artillery.io:8080',
  phases: [
    { duration: 5, arrivalRate: 1, rampTo: 5, name: 'Warm up phase' },
    { duration: 5, arrivalRate: 5, rampTo: 10, name: 'Ramp up load' },
    // { duration: 30, arrivalRate: 10, rampTo: 30, name: "Spike phase" },
  ],
  variables: {
    paths: ['/dino', '/pony', '/armadillo'],
  },
  plugins: {
    ensure: {
      thresholds: [
        { 'http.response_time.p99': 100 },
        { 'http.response_time.p95': 75 },
      ],
    },
    apdex: { threshold: 100 },
    'metrics-by-endpoint': {},
  },
};

export const scenarios = [
  {
    flow: [
      {
        loop: [
          { log: '*** GET path {{ $loopElement }}' },
          { get: { url: '{{ $loopElement }}' } },
        ],
        over: 'paths',
      },
    ],
  },
];

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions