mirror of
https://github.com/getAlby/hub.git
synced 2026-08-13 12:33:39 +02:00
The mock event consumer waited a fixed 10ms before returning consumed events, which was not always enough on slow CI runners and caused flaky failures (e.g. TestMarkSettled_App_BudgetWarning missing its nwc_budget_warning event). It also appended to the events slice from concurrent goroutines without synchronization, a data race that could drop events. - guard the consumed events slice with a mutex and return copies - add WaitForConsumedEvents which polls until the expected number of events arrived (up to 5s) instead of relying on a fixed sleep - use it in tests that assert on consumed events; tests asserting that no event was published keep the short grace period - normalize event order in the keysend self-payment test, matching the existing approach in the self-payment test, since async publishing does not guarantee ordering Co-authored-by: Claude Fable 5 <noreply@anthropic.com> |
||
|---|---|---|
| .. | ||
| app_payments_test.go | ||
| check_unsettled_transaction_test.go | ||
| hold_invoice_self_payment_consumer.go | ||
| isolated_app_payments_test.go | ||
| keysend_test.go | ||
| list_transactions_test.go | ||
| lookup_transaction_test.go | ||
| make_invoice_test.go | ||
| notifications_test.go | ||
| payments_test.go | ||
| receive_keysend_test.go | ||
| self_hold_payments_test.go | ||
| self_payment_detection_test.go | ||
| self_payments_test.go | ||
| transactions_service.go | ||
| user_labels_test.go | ||