9o7cga
Last Updated: February 25, 2016
·
535
· afeld
5e6ceef905d14ade228ea22c445d57bc

Run a bash command until it fails

Useful for finding flaky tests/specs, etc. Modify the COMMAND below and paste into your terminal:

# tweak these
TRIES=5
COMMAND="bundle exec rspec"

# tweaked from http://unix.stackexchange.com/a/82602
n=0
until [ $n -ge $TRIES ]
do
  $COMMAND || break
  n=$[$n+1]
done
Say Thanks
Respond
Filed Under