Skip to content

Instantly share code, notes, and snippets.

@cancerberoSgx
Created April 25, 2018 04:27
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save cancerberoSgx/4c2e768066c8f190f97399f87aac5868 to your computer and use it in GitHub Desktop.
Save cancerberoSgx/4c2e768066c8f190f97399f87aac5868 to your computer and use it in GitHub Desktop.
# Usage examle:
# $ time sh testing/repeatUntilFails.sh "npm run test-nobuild"
counter=0
while true; do
eval $1
if [[ "$?" -ne 0 ]]; then
echo
echo "*******"
echo " * FAILURE at loop #"$counter
echo "*******"
echo
exit 1
fi
counter=$((counter+1))
echo
echo "*******"
echo " * TIME: "$counter
echo "*******"
echo
sleep 2s
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment