Skip to content

Commit

Permalink
integration tests: wait until all nodes are stopped
Browse files Browse the repository at this point in the history
  • Loading branch information
kroggen committed Nov 9, 2024
1 parent 9d04169 commit 2e36137
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion tests/common.sh
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,12 @@ stop_nodes() {

if [ "$consensus" == "sbp" ]; then
kill $pid
# wait until the node is stopped
wait $pid
else
kill $pid1 $pid2 $pid3
# wait until all nodes are stopped
wait $pid1 $pid2 $pid3
fi

}
Expand Down Expand Up @@ -94,6 +98,8 @@ get_receipt() {
# do not stop on errors
set +e

# wait for a total of (0.4 * 100) = 40 seconds

while true; do
output=$(../bin/aergocli receipt get $txhash --port $query_port 2>&1 > receipt.json)

Expand All @@ -102,7 +108,7 @@ get_receipt() {
if [[ $output == *"tx not found"* ]]; then
sleep 0.4
counter=$((counter+1))
if [ $counter -gt 10 ]; then
if [ $counter -gt 100 ]; then
echo "Error: tx not found: $txhash"
exit 1
fi
Expand Down

0 comments on commit 2e36137

Please sign in to comment.