Trying to setup a Travis bash script where we run our application to make sure it starts up fine similar to CRON. If it does then we can pass the build. Testing catches errors on start up. However, it is an API (CloudFactory) server and if I run the binary and it is successful it will just run indefinitely like infinite loop.
I did:
timeout --preserve-status 20s <binary>
This just returns the code of the binary which is 143 when killed from a timeout.
timeout 20s <binary>
This returns exit 127 when successful.
Any script I could use that runs the binary fails if the binary errors on startup and if sucessful starting up say after 20-25 seconds exits with 0 to pass the Travis build? Thank you.