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

Custom exit code setting for threshold #1778

Closed
lemon-li opened this issue Dec 30, 2020 · 4 comments
Closed

Custom exit code setting for threshold #1778

lemon-li opened this issue Dec 30, 2020 · 4 comments
Labels

Comments

@lemon-li
Copy link

Feature Description

When I run K6 in the docker, if threshold fails, it will cause exit code 99 (#870).

I expect that it should be possible to customize the configuration, because my monitoring system will catch the exit, thinking this is an unexpected exit.

@na--
Copy link
Member

na-- commented Jan 4, 2021

@lemon-li, can you share some more details about your use case? And can you look through #680 and #870 and explain how the feature you want differs from them?

@lemon-li
Copy link
Author

lemon-li commented Jan 7, 2021

@lemon-li, can you share some more details about your use case? And can you look through #680 and #870 and explain how the feature you want differs from them?

thank you for your reply,I think that same feature.
when the threshold fails, I can change the exit code from 99 to 0.

@na--
Copy link
Member

na-- commented Jan 7, 2021

I still don't understand precisely why you want to do that, sorry. After all, the main purpose of the k6 thresholds is to act as a pass/fail criteria for the load test, so k6 returning with non-zero exit code is precisely meant to signal the CI system to treat the test run as a failure... In any case, wouldn't suppressing the exit code this way also work:

k6 run whatever.js || true

This way, even if k6 exits with a non-zero code, the script/CI job will not abort.

@na--
Copy link
Member

na-- commented Jan 26, 2021

Closing this issue due to lack of response. I though about it some more and there's a valid use case for wanting a 0 exit code for some thresholds, but that is tracked in #680 (comment)

@na-- na-- closed this as completed Jan 26, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants