Introduced wait group that was not used to wait.

This commit is contained in:
Lucas Rouckhout
2023-07-14 15:29:08 +02:00
parent adcd68477e
commit d94fd75aa8

View File

@@ -3,7 +3,6 @@ package rabbitmq_test
import ( import (
"context" "context"
"encoding/json" "encoding/json"
"sync"
"testing" "testing"
"time" "time"
@@ -88,14 +87,11 @@ func TestFinalizedInitializedPayments(t *testing.T) {
ch <- amqp.Delivery{Body: successPayment} ch <- amqp.Delivery{Body: successPayment}
ch <- amqp.Delivery{Body: failedPayment} ch <- amqp.Delivery{Body: failedPayment}
wg := sync.WaitGroup{}
wg.Add(1)
go func() { go func() {
err = client.FinalizeInitializedPayments(ctx, lndHubService) err = client.FinalizeInitializedPayments(ctx, lndHubService)
assert.NoError(t, err) assert.NoError(t, err)
wg.Done()
}() }()
//wait a bit for payments to be processed //wait a bit for payments to be processed