Skip to content

Commit

Permalink
test(core): remove subscriber sleep
Browse files Browse the repository at this point in the history
  • Loading branch information
vindard committed Dec 20, 2023
1 parent f471d3a commit 8c2fc05
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 2 deletions.
2 changes: 1 addition & 1 deletion bats/core/api/ln-receive.bats
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ setup_file() {
fund_user_onchain "$ALICE" 'btc_wallet'

subscribe_to "$ALICE" my-updates-sub
sleep 3
retry 10 1 subscriber_is_up
}

teardown_file() {
Expand Down
3 changes: 2 additions & 1 deletion bats/helpers/ln.bash
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,8 @@ check_for_ln_update() {
retry 10 1 \
grep "Data.*LnUpdate.*$payment_hash" "$SUBSCRIBER_LOG_FILE" \
| awk '{print $2}' \
| jq -r --arg hash "$payment_hash" 'select(.data.myUpdates.update.paymentHash == $hash)'
| jq -r --arg hash "$payment_hash" 'select(.data.myUpdates.update.paymentHash == $hash)' \
|| exit 1

paid_status=$( \
grep 'Data.*LnUpdate' "$SUBSCRIBER_LOG_FILE" \
Expand Down
4 changes: 4 additions & 0 deletions bats/helpers/subscriber.bash
Original file line number Diff line number Diff line change
Expand Up @@ -29,3 +29,7 @@ stop_subscriber() {
[[ -f "$SUBSCRIBER_PID_FILE" ]] && kill $(cat $SUBSCRIBER_PID_FILE) > /dev/null || true
}

subscriber_is_up() {
grep "Data:" "$SUBSCRIBER_LOG_FILE"
return "$?"
}

0 comments on commit 8c2fc05

Please sign in to comment.