-
Notifications
You must be signed in to change notification settings - Fork 22
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
Example with Return error instead of killing process doesn't work #25
Comments
I noticed that too, and would like to know the answer. For the time being, I'm able to build by pointing to the specific commit, in case it helps:
|
@jokuniew @vvakar I can't reproduce the error you mention. The example is working as expected. The command executed with the
|
@pablochacin It's very curious. I pasted the full terminal log below showing that the 0.4.0 version is somehow missing the fix, but the specific commit has it:
|
To avoid any golang/binary misconfiguration I've tried to use xk6 through docker image with ./k6 version
k6 v0.51.0 (go1.22.4, linux/amd64)
Extensions:
github.com/grafana/xk6-exec v0.4.0, k6/x/exec [js] ./k6 run examples/script.js
/\ |‾‾| /‾‾/ /‾‾/
/\ / \ | |/ / / /
/ \/ \ | ( / ‾‾\
/ \ | |\ \ | (‾) |
/ __________ \ |__| \__\ \_____/ .io
execution: local
script: examples/script.js
output: -
scenarios: (100.00%) 1 scenario, 1 max VUs, 10m30s max duration (incl. graceful stop):
* default: 1 iterations for each of 1 VUs (maxDuration: 10m0s, gracefulStop: 30s)
INFO[0000] Tue Sep 3 09:08:04 AM UTC 2024 source=console
INFO[0000] 2024/09/03 09:08:04 exit status 2 on command: ls -a NO_SUCH_DIR |
v0.4.1 works, thanks!! :) |
Fixed in release v0.4.1 |
I can also confirm that v0.4.1 works fine. Thanks @pablochacin ! ;) |
I've built and installed k6 with latest xk6-exec
then run
k6 run examples/script.js
the example introduced in #24the output i get
INFO[0000] Tue Jul 30 01:21:29 PM UTC 2024 source=console INFO[0000] 2024/07/30 13:21:29 exit status 2 on command: ls -a NO_SUCH_DIR
I expected to see logs like "ERROR: " or "STDERR: " in this example but actually my test panic and stopped.
I can't handle exec.command errors in try catch statement
@pablochacin @vvakar
The text was updated successfully, but these errors were encountered: