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

http_req_failed passes and fails count reversed #2386

Closed
DaveSenn opened this issue Feb 14, 2022 · 1 comment
Closed

http_req_failed passes and fails count reversed #2386

DaveSenn opened this issue Feb 14, 2022 · 1 comment

Comments

@DaveSenn
Copy link

Brief summary

It Looks like the values for http_req_failed passes nad fails are switched in the consule output and the summary JSON.

Ths console shows 0% fails but all requests (400) are lsited under failed:
Capture

The same in the summary JSON:

        "http_req_failed": {
            "passes": 0,
            "fails": 400,
            "value": 0
        },

I've checked..all requests are successful (200 OK).

Here my script:

import http from 'k6/http';
import { getUserToken } from '../../Helpers/UserTokenHelper.js';

let advertisementImageId = null;

export default function (data) {
  getAdvertisementImage(data);
};

function getAdvertisementImage(data) {
  const url = `${__ENV.API_Url}AdvertisementImage/${advertisementImageId}/image?imageSize=Small`;
  const params = {
    headers: {
      'Content-Type': __ENV.API_ContentType,
      'Accept-Encoding': __ENV.API_Compression,
      'api-version': __ENV.API_Version,
      'user-token': data.userToken
    }
  }

  // Request
  const res = http.get(url, params);
}

// Setup
export function setup() {
  const userToken = getUserToken();

  return {
    userToken: userToken
  }
}

k6 version

k6 v0.36.0 (2022-01-24T09:50:03+0000/ff3f8df, go1.17.6, windows/amd64)

OS

Windows 10 21H2

Docker version and image (if applicable)

No response

Steps to reproduce the problem

Run the script.
Add --summary-export="Test.json" for summary output.

Expected behaviour

Switch the counters.

Actual behaviour

...

@DaveSenn DaveSenn added the bug label Feb 14, 2022
@efdknittlfrank
Copy link

Looks like a duplicate of #2306. To quote @na-- :

Thanks for reporting this! Technically, since the http_req_failed metric is tracking the failures, it's technically correct. But yeah, that's super confusing 😞
#2306 (comment)

@na-- na-- added the duplicate label Feb 15, 2022
joyadauche added a commit to joyadauche/ci-load-test that referenced this issue Feb 11, 2024
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

3 participants