-
Notifications
You must be signed in to change notification settings - Fork 470
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
Add timeout parameter to command
#20
Comments
Initial idea: # default timeout is 10s
$ goss a command 'sleep 1;echo "hi"'
Adding Command to './goss.json':
{
"sleep 1;echo \"hi\"": {
"exit-status": "0",
"stdout": [
"hi"
],
"stderr": [],
"timeout": 10000
}
}
# Happy path
$ goss validate
..
Total Duration: 1.011s
Count: 2, Failed: 0
$ sed -i 's/sleep 1/sleep 11/' goss.json
# Command took too long
$ goss validate
FF
Failures:
sleep 11;echo "hi": exit-status: Error: Command execution timed out (10000 milliseconds)
sleep 11;echo "hi": stdout: Error: Command execution timed out (10000 milliseconds)
Total Duration: 10.007s
Count: 2, Failed: 2 @stephanbuys how does that look? One drawback with current implementation is that For now I think it's a minor inconvenience. In the future, I'll probably revamp the timeout to be dynamically set based on maybe |
I like your last suggestion |
This has been added to v0.0.18 |
command should have a timeout parameter, similar to dns and addr lookups #19
The text was updated successfully, but these errors were encountered: