diff --git a/integration_tests/create_test.go b/integration_tests/create_test.go index 2d7d69d..d8161cb 100644 --- a/integration_tests/create_test.go +++ b/integration_tests/create_test.go @@ -69,6 +69,7 @@ func TestCreateUserTestSuite(t *testing.T) { func LndHubTestServiceInit() (*service.LndhubService, error) { // change this if you want to run tests using sqlite // dbUri := "file:data_test.db" + //make sure the datbase is empty every time you run the test suite dbUri := "postgresql://user:password@localhost/lndhub?sslmode=disable" c := &service.Config{ DatabaseUri: dbUri, @@ -120,7 +121,5 @@ func LndHubTestServiceInit() (*service.LndhubService, error) { logger.Fatalf("Failed to parse node IdentityPubkey: %v", err) } svc.IdentityPubkey = identityPubKey - // Subscribe to LND invoice updates in the background - go svc.InvoiceUpdateSubscription(context.Background()) return svc, nil } diff --git a/integration_tests/incoming_payment_test.go b/integration_tests/incoming_payment_test.go index e74dad4..a175e1b 100644 --- a/integration_tests/incoming_payment_test.go +++ b/integration_tests/incoming_payment_test.go @@ -47,6 +47,8 @@ func (suite *IncomingPaymentTestSuite) SetupSuite() { if err != nil { log.Fatalf("Error initializing test service: %v", err) } + // Subscribe to LND invoice updates in the background + go svc.InvoiceUpdateSubscription(context.Background()) suite.service = svc e := echo.New()