Skip to content

test: Attempt to fix flaky equivocation test#1457

Draft
romac wants to merge 4 commits intocirclefin:mainfrom
romac:fix-equivocation-test
Draft

test: Attempt to fix flaky equivocation test#1457
romac wants to merge 4 commits intocirclefin:mainfrom
romac:fix-equivocation-test

Conversation

@romac
Copy link
Contributor

@romac romac commented Feb 6, 2026

No description provided.

@romac romac marked this pull request as ready for review February 9, 2026 22:45
@romac romac requested a review from ancazamfir as a code owner February 9, 2026 22:45
@romac romac marked this pull request as draft February 9, 2026 22:48
@romac
Copy link
Contributor Author

romac commented Feb 9, 2026

Still seems flaky when running it in a loop locally

@romac
Copy link
Contributor Author

romac commented Feb 9, 2026

For anyone interested, here is the script I am using the check for flakiness:

#!/bin/bash

# Configuration
# Usage: ./flake_check.sh [number_of_runs]
MAX_RUNS=${1:-50} # Default to 50 runs if no argument provided
CMD="cargo nextest run -p informalsystems-malachitebft-test --test it equivocation_two_vals_same_pk --retries 0"

echo "🔍 Starting Flake Detection"
echo "Target: $CMD"
echo "Plan: Run $MAX_RUNS times (or until failure)"
echo "---------------------------------------------------"

for ((i=1; i<=MAX_RUNS; i++)); do
    printf "Run #%d ... " "$i"
    
    # Run the command, capturing output to a temporary file
    if $CMD > last_run.log 2>&1; then
        echo "✅ PASSED"
    else
        echo "❌ FAILED"
        echo ""
        echo "The test failed on run #$i."
        echo "---------------------------------------------------"
        echo "Failure Logs:"
        cat last_run.log
        echo "---------------------------------------------------"
        rm last_run.log
        exit 1
    fi
done

rm last_run.log
echo "---------------------------------------------------"
echo "🎉 Success: The test survived $MAX_RUNS runs without failing."

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant