-
-
Notifications
You must be signed in to change notification settings - Fork 347
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
Option to return the status code of a failed command #756
Comments
You can use the |
I can't seem to get that to work. Even just I assume the issue is that the initial measurement (or the warmup if that's enabled) returns an error? Can't exactly write a meaningful mean time in that case. To clarify, that is what happens when a test in my benchmarking script sends too big a payload to the server. It errors on the first try. |
Oh, you also need:
As written in the error message:
|
I can make that work since I'm already exporting the json and using jq to get a list of the mean times, but that would be very annoying for anyone who wants a portable script that doesn't depend on either. |
I'm not really sure what you're asking for. |
hyperfine "exit 4"
echo $? # 1 (current behavior)
hyperfine --return-error "exit 4"
echo $? # 4 |
For part of a thing I'm working on, I use Hyperfine to benchmark an HTTP server using Curl. If I mess up writing the tests the server can return a 413 "Content Too Large" error and, because Curl is being run with the
--fail
/-f
flag, Curl returns an exit code of 22.Afterwards the bash script I use for benchmarking checks if Hyperfine returned a non-zero exit code and print some details on what could've gone wrong and what to do to fix it.
It'd be nice if I could tell which exact exit code Curl returned and provide only the necessary solution.
The text was updated successfully, but these errors were encountered: