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

Invalid option value exits with code 255 instead of 104 Invalid Config #3759

Closed
oleiade opened this issue May 28, 2024 · 1 comment · Fixed by #3783
Closed

Invalid option value exits with code 255 instead of 104 Invalid Config #3759

oleiade opened this issue May 28, 2024 · 1 comment · Fixed by #3783
Assignees

Comments

@oleiade
Copy link
Member

oleiade commented May 28, 2024

Brief summary

As a user, I would expect the following script to make k6 exit with code 104 (InvalidConfig):

 export const options = {
    vus: 'this is an invalid type',
}

export default function () {}

However, when running it, I get the following error message: ERRO[0000] could not initialize 'invalid-config.js': could not load JS test 'file:///Users/theocrevon/Dev/grafana/sandbox/k6-scripts/exitcodes/invalid-config.js': strconv.ParseInt: parsing "does not exist": invalid syntax, which I expect.

But echo $status (pardon the fish shell syntax) returns 255, which is uint8 for -1, which in my understanding is the "catch all" exit code.

k6 version

v0.51.0

OS

MacOS

Docker version and image (if applicable)

No response

Steps to reproduce the problem

k6 run the-script-above.js

Expected behaviour

As a user, I would expect this to set the exit code to 104 InvalidConfig.

Actual behaviour

Sets the exit code to 255 (uint8 equivalent of -1)

@ariasmn
Copy link
Contributor

ariasmn commented Jun 7, 2024

Hi! @oleiade

Had some free time and decided to open a PR to solve this issue (#3783)

PTAL and let me know what you think!

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

Successfully merging a pull request may close this issue.

2 participants