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

Script to run e2e test in loop to detect flaky test #274

Closed
wants to merge 2 commits into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
31 changes: 31 additions & 0 deletions scripts/test-e2e.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
#!/usr/bin/env bash

# end on sigint
STOP=""
trap "STOP=1" INT


NUM_RUNS=${1:-100}
TOTAL=$NUM_RUNS
FAILURES=0
export NO_COLOR=1
rm /tmp/librqbit_e2e_failures.log
while [ $NUM_RUNS -gt 0 ]; do
echo Running test $((TOTAL - NUM_RUNS + 1)) of $TOTAL
NUM_RUNS=$((NUM_RUNS - 1))
cargo test --package librqbit tests::e2e::test_e2e_download > /tmp/librqbit_e2e_run.log
res=$?
if [ $res -ne 0 ]; then
FAILURES=$((FAILURES + 1))
echo "FAILURE with code $res" >> /tmp/librqbit_e2e_failures.log
tail -50 /tmp/librqbit_e2e_run.log >> /tmp/librqbit_e2e_failures.log
echo "----------------------------------------------" >> /tmp/librqbit_e2e_failures.log

fi
if [ "$STOP" = "1" ]; then
break
fi
done
rm /tmp/librqbit_e2e_run.log
echo "Total runs : $TOTAL, failures : $FAILURES"
echo "Failures log /tmp/librqbit_e2e_failures.log"