mirror of
https://github.com/lightninglabs/lightning-terminal.git
synced 2026-08-13 12:33:36 +02:00
make: unit test flake hunter
For convenient flake hunting.
This commit is contained in:
parent
86fc34fb2b
commit
ccb1b64f8b
3 changed files with 36 additions and 0 deletions
23
scripts/unit-test-flake-hunter.sh
Executable file
23
scripts/unit-test-flake-hunter.sh
Executable file
|
|
@ -0,0 +1,23 @@
|
|||
#!/bin/bash
|
||||
|
||||
# Check if pkg and case variables are provided.
|
||||
if [ $# -lt 2 ] || [ $# -gt 3 ]; then
|
||||
echo "Usage: $0 <pkg> <case> [timeout]"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
pkg=$1
|
||||
case=$2
|
||||
timeout=${3:-30s} # Default to 30s if not provided.
|
||||
|
||||
counter=0
|
||||
|
||||
# Run the command in a loop until it fails.
|
||||
while output=$(go clean -testcache && make unit-debug log="stdlog trace" pkg=$pkg case=$case timeout=$timeout 2>&1); do
|
||||
((counter++))
|
||||
echo "Test $case passed, count: $counter"
|
||||
done
|
||||
|
||||
# Only log the output when it fails.
|
||||
echo "Test $case failed. Output:"
|
||||
echo "$output"
|
||||
Loading…
Add table
Add a link
Reference in a new issue