Skip to content

Instantly share code, notes, and snippets.

@Arinono
Last active September 2, 2022 12:45
Show Gist options
  • Save Arinono/d5718e690f5cc5eb6fa1455c0940fb55 to your computer and use it in GitHub Desktop.
Save Arinono/d5718e690f5cc5eb6fa1455c0940fb55 to your computer and use it in GitHub Desktop.
WTG Platform flaky test script
#!/usr/bin/env bash
if [ -z "$1" ]; then
echo "Usage: $0 <nb runs>"
exit 1
fi
rm out.tmp
nb_runs=$1
for i in `seq 1 $nb_runs`; do
delay=4011+$i
cat test/integration/command/add.test.ts | sed "s/4001/$delay/g" > "test/integration/command/add$i.test.ts"
npm run test | tee -a out.tmp
done
for i in `seq 1 $nb_runs`; do
rm "test/integration/command/add$i.test.ts"
done
echo "`cat out.tmp | rg '❌' | wc -l` errors"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment