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

setup() and teardown() errors and timeouts don't change the k6 exit code #868

Closed
na-- opened this issue Dec 14, 2018 · 1 comment
Closed

Comments

@na--
Copy link
Member

na-- commented Dec 14, 2018

When there's an error in the setup() or teardown() function or when they time out, k6 will abort the script execution and print something like ERRO[0000] Engine error error="setup: Error: my_intentional_error at setup (...) or ERRO[0010] Engine error error="setup: context cancelled at setup (...)", but the actual exit code of k6 itself will still be 0, as if everything is OK.

This is in stark contrast to errors in the init code, which immediately abort k6 and change the exit code to 255. The actual error code is subject to future change, the important point is that it's not 0. The setup() and teardown() functions should behave the same way, since there's no concurrency with their execution, it's just a single transient VU executing them and it's important for users to have feedback that something went wrong during their execution.

@na--
Copy link
Member Author

na-- commented Dec 14, 2018

Just as as pointer when we fix this, this is where we log the error and stop the script, but we don't change the actual exit code.

Also, as mentioned in this issue, it'd probably be worth it if these errors had their own specific exit codes.

mstoykov added a commit that referenced this issue Jan 7, 2019
There are now 4 new non zero exit codes that will be revisioned at later
date when we more exit codes arise.

The 4 new ones are for each of setup and teardown timeouts, if it is a
timeout in the engine but it is not in setup/teardown - no such is known
at this time and 1 for engine error which is not timeout.
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

1 participant