Skip to content
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

timeout command not on macOS #108

Open
zam6ak opened this issue May 4, 2021 · 8 comments
Open

timeout command not on macOS #108

zam6ak opened this issue May 4, 2021 · 8 comments

Comments

@zam6ak
Copy link

zam6ak commented May 4, 2021

Seems like timeout is not available on macOS

wait-for-it.sh  www.google.com:443 --timeout=10 -- echo "its up"
readlink: illegal option -- f
usage: readlink [-n] [file ...]
./scripts/wait-for-it.sh: line 58: timeout: command not found
wait-for-it.sh: timeout occurred after waiting 10 seconds for www.google.com:443
its up
@twistezo
Copy link

brew install coreutils
alias timeout=gtimeout

🎉

@deiga
Copy link

deiga commented Jul 23, 2021

@twistezo This doesn't really solve the issue, as wait-for-it is supposed to be a standalone executable

@roerohan
Copy link

@deiga wait-for-it is a bash script, so it depends on the packages you have installed.
If you're looking for a standalone executable, you can check out wait-for-it - a binary executable built in golang

@deiga
Copy link

deiga commented Sep 28, 2021

@roerohan Sure, it's a bash script, but are any of the packages it uses not system defaults?

@roerohan
Copy link

@deiga I'm not sure about how it works on mac, I'm hoping someone else can answer.
Also it's been really long so I'm assuming you might have figured it out 😛

@hujesse83
Copy link

same question. it's not working on mac

@Ezward
Copy link

Ezward commented Jun 15, 2022

We do our development on Mac and deploy to Linux. I need to be able to run locally before I commit, so Linux only is a problem. Is there an alternative solution?

@ougarcia
Copy link

I added this to the beginning of the script. Works on mac for local dev and linux for ci

if [[ $OSTYPE == 'darwin'* ]]; then
  if ! command -v gtimeout &> /dev/null
  then
      echo "missing gtimeout (`brew install coreutils`)"
      exit
  fi
  alias timeout=gtimeout
fi

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

8 participants
@deiga @zam6ak @Ezward @ougarcia @twistezo @roerohan @hujesse83 and others