mirror of
https://github.com/lightningnetwork/lnd.git
synced 2025-09-14 02:15:29 +02:00
Merge pull request #5725 from bottlepay/fix-amp-itest
lntest/itest: fix SendPaymentAMP test
This commit is contained in:
@@ -225,6 +225,8 @@ you.
|
|||||||
|
|
||||||
* [Fixed restore backup file test flake with bitcoind](https://github.com/lightningnetwork/lnd/pull/5637).
|
* [Fixed restore backup file test flake with bitcoind](https://github.com/lightningnetwork/lnd/pull/5637).
|
||||||
|
|
||||||
|
* [Timing fix in AMP itest](https://github.com/lightningnetwork/lnd/pull/5725)
|
||||||
|
|
||||||
## Database
|
## Database
|
||||||
|
|
||||||
* [Ensure single writer for legacy
|
* [Ensure single writer for legacy
|
||||||
|
@@ -38,6 +38,15 @@ func testSendPaymentAMPInvoiceCase(net *lntest.NetworkHarness, t *harnessTest,
|
|||||||
ctx := newMppTestContext(t, net)
|
ctx := newMppTestContext(t, net)
|
||||||
defer ctx.shutdownNodes()
|
defer ctx.shutdownNodes()
|
||||||
|
|
||||||
|
// Subscribe to bob's invoices. Do this early in the test to make sure
|
||||||
|
// that the subscription has actually been completed when we add an
|
||||||
|
// invoice. Otherwise the notification will be missed.
|
||||||
|
req := &lnrpc.InvoiceSubscription{}
|
||||||
|
ctxc, cancelSubscription := context.WithCancel(ctxb)
|
||||||
|
bobInvoiceSubscription, err := ctx.bob.SubscribeInvoices(ctxc, req)
|
||||||
|
require.NoError(t.t, err)
|
||||||
|
defer cancelSubscription()
|
||||||
|
|
||||||
const paymentAmt = btcutil.Amount(300000)
|
const paymentAmt = btcutil.Amount(300000)
|
||||||
|
|
||||||
// Set up a network with three different paths Alice <-> Bob. Channel
|
// Set up a network with three different paths Alice <-> Bob. Channel
|
||||||
@@ -61,13 +70,6 @@ func testSendPaymentAMPInvoiceCase(net *lntest.NetworkHarness, t *harnessTest,
|
|||||||
|
|
||||||
ctx.waitForChannels()
|
ctx.waitForChannels()
|
||||||
|
|
||||||
// Subscribe to bob's invoices.
|
|
||||||
req := &lnrpc.InvoiceSubscription{}
|
|
||||||
ctxc, cancelSubscription := context.WithCancel(ctxb)
|
|
||||||
bobInvoiceSubscription, err := ctx.bob.SubscribeInvoices(ctxc, req)
|
|
||||||
require.NoError(t.t, err)
|
|
||||||
defer cancelSubscription()
|
|
||||||
|
|
||||||
addInvoiceResp, err := ctx.bob.AddInvoice(context.Background(), &lnrpc.Invoice{
|
addInvoiceResp, err := ctx.bob.AddInvoice(context.Background(), &lnrpc.Invoice{
|
||||||
Value: int64(paymentAmt),
|
Value: int64(paymentAmt),
|
||||||
IsAmp: true,
|
IsAmp: true,
|
||||||
|
Reference in New Issue
Block a user