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

fix: disable flaky MarketAddBalance #4850

Merged
merged 1 commit into from
Oct 7, 2024
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
103 changes: 52 additions & 51 deletions scripts/tests/calibnet_wallet_check.sh
Original file line number Diff line number Diff line change
Expand Up @@ -25,57 +25,58 @@ forest_init
$FOREST_WALLET_PATH import preloaded_wallet.key
$FOREST_WALLET_PATH --remote-wallet import preloaded_wallet.key

: Begin Filecoin.MarketAddBalance test

FOREST_URL='http://127.0.0.1:2345/rpc/v1'

# Amount to add to the Market actor (in attoFIL)
MARKET_FIL_AMT="23"

# The preloaded address
REMOTE_ADDR=$($FOREST_WALLET_PATH --remote-wallet list | tail -1 | cut -d ' ' -f1)

JSON=$(curl -s -X POST "$FOREST_URL" \
--header 'Accept: application/json' \
--header 'Content-Type: application/json' \
--header "Authorization: Bearer $ADMIN_TOKEN" \
--data "$(jq -n --arg addr "$REMOTE_ADDR" --arg amt "$MARKET_FIL_AMT" '{jsonrpc: "2.0", id: 1, method: "Filecoin.MarketAddBalance", params: [$addr, $addr, $amt]}')")

echo "$JSON"

if [[ $(echo "$JSON" | jq -e '.result') == "null" ]]; then
echo "Error while sending message."
exit 1
fi

MSG_CID=$(echo "$JSON" | jq -r '.result["/"]')
echo "Message cid: $MSG_CID"

# Try 30 times (in other words wait for 5 tipsets)
for i in {1..30}
do
sleep 5s
echo "Attempt $i:"

JSON=$(curl -s -X POST "$FOREST_URL" \
--header 'Content-Type: application/json' \
--data "$(jq -n --arg cid "$MSG_CID" '{jsonrpc: "2.0", id: 1, method: "Filecoin.StateSearchMsg", params: [[], {"/": $cid}, 800, true]}')")

echo "$JSON"

# Check if the message has been mined.
if echo "$JSON" | jq -e '.result' > /dev/null; then
echo "Message found, exiting."
break
fi

echo -e "\n"
done

if [[ $(echo "$JSON" | jq -e '.result') == "null" ]]; then
echo "Error while sending message."
exit 1
fi
# Test commented out due to it being flaky. See the tracking issue: https://github.com/ChainSafe/forest/issues/4849
# : Begin Filecoin.MarketAddBalance test
#
# FOREST_URL='http://127.0.0.1:2345/rpc/v1'
#
# # Amount to add to the Market actor (in attoFIL)
# MARKET_FIL_AMT="23"
#
# # The preloaded address
# REMOTE_ADDR=$($FOREST_WALLET_PATH --remote-wallet list | tail -1 | cut -d ' ' -f1)
#
# JSON=$(curl -s -X POST "$FOREST_URL" \
# --header 'Accept: application/json' \
# --header 'Content-Type: application/json' \
# --header "Authorization: Bearer $ADMIN_TOKEN" \
# --data "$(jq -n --arg addr "$REMOTE_ADDR" --arg amt "$MARKET_FIL_AMT" '{jsonrpc: "2.0", id: 1, method: "Filecoin.MarketAddBalance", params: [$addr, $addr, $amt]}')")
#
# echo "$JSON"
#
# if [[ $(echo "$JSON" | jq -e '.result') == "null" ]]; then
# echo "Error while sending message."
# exit 1
# fi
#
# MSG_CID=$(echo "$JSON" | jq -r '.result["/"]')
# echo "Message cid: $MSG_CID"
#
# # Try 30 times (in other words wait for 5 tipsets)
# for i in {1..30}
# do
# sleep 5s
# echo "Attempt $i:"
#
# JSON=$(curl -s -X POST "$FOREST_URL" \
# --header 'Content-Type: application/json' \
# --data "$(jq -n --arg cid "$MSG_CID" '{jsonrpc: "2.0", id: 1, method: "Filecoin.StateSearchMsg", params: [[], {"/": $cid}, 800, true]}')")
#
# echo "$JSON"
#
# # Check if the message has been mined.
# if echo "$JSON" | jq -e '.result' > /dev/null; then
# echo "Message found, exiting."
# break
# fi
#
# echo -e "\n"
# done
#
# if [[ $(echo "$JSON" | jq -e '.result') == "null" ]]; then
# echo "Error while sending message."
# exit 1
# fi

: Begin wallet tests

Expand Down
Loading