Skip to content

chore: Make ibc integration test more resilent #171

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

Merged
merged 2 commits into from
Jul 2, 2025
Merged
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
34 changes: 27 additions & 7 deletions .github/workflows/integration_test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -360,12 +360,32 @@ jobs:
ROLLKIT_ADDR=$(./gmd/go/bin/gmd keys show carol -a --home ./gmd/.gm)
CELESTIA_ADDR=$(celestia-appd keys show validator -a --keyring-backend test)
celestia-appd tx ibc-transfer transfer transfer channel-0 $ROLLKIT_ADDR 100utia --from validator --node http://localhost:26654 --fees 400utia --keyring-backend test -y
sleep 15
BALANCE=$(./gmd/go/bin/gmd query bank balances $ROLLKIT_ADDR --output json --home ./gmd/.gm | jq '.balances')
echo "Gm balance after IBC transfer: $BALANCE"
# fail if no denom starts with ibc/
if ! echo "$BALANCE" | jq -e '.[] | select(.denom | startswith("ibc/"))' > /dev/null; then
echo "Error: No IBC denom found in balance after transfer!"

# Wait for IBC transfer to complete with retry logic
echo "Waiting for IBC transfer to complete..."
MAX_ATTEMPTS=30
ATTEMPT=0
IBC_FOUND=false

while [ $ATTEMPT -lt $MAX_ATTEMPTS ] && [ "$IBC_FOUND" = false ]; do
sleep 3
ATTEMPT=$((ATTEMPT+1))

BALANCE=$(./gmd/go/bin/gmd query bank balances $ROLLKIT_ADDR --output json --home ./gmd/.gm | jq '.balances')
echo "Attempt $ATTEMPT/$MAX_ATTEMPTS - Gm balance: $BALANCE"

# Check if any denom starts with ibc/
if echo "$BALANCE" | jq -e '.[] | select(.denom | startswith("ibc/"))' > /dev/null; then
IBC_FOUND=true
echo "✅ IBC transfer successful! IBC denom found in balance."
else
echo "IBC denom not found yet, retrying in 3 seconds..."
fi
done

if [ "$IBC_FOUND" = false ]; then
echo "Error: No IBC denom found in balance after transfer within $MAX_ATTEMPTS attempts!"
echo "Final balance: $BALANCE"
exit 1
fi

Expand Down Expand Up @@ -393,4 +413,4 @@ jobs:
fi
if [[ -n "${HERMES_PID}" ]]; then
kill -9 $HERMES_PID || true
fi
fi
Loading