I am running these two commands in a CI pipeline:
go run . & # Start a local server on port 8080
curl localhost:8080 > result.yml # Save the response to a file
Current result: I get the error curl: (7) Failed to connect to localhost port 8080 after 0 ms: Connection refused
Needed result: curl waits for x seconds until it returns this error.
I have tried the options --connect-timeout and --max-time (Source), but they don't do what I need.
Is there a CLI option for that, or do I have to write a shell script?