itest: remove unnecessary channel close and node shutdown
Since we don't have standby nodes anymore, we don't need to close the channels when the test finishes. Previously we would do so to make sure the standby nodes have a clean state for the next test case, which is no longer relevant.
This commit is contained in:
33 files changed
+47
-447
No files matched your search
@@ -477,9 +477,7 @@ func testListPayments(ht *lntest.HarnessTest) {
|
||||
// Open a channel with 100k satoshis between Alice and Bob with Alice
|
||||
// being the sole funder of the channel.
|
||||
chanAmt := btcutil.Amount(100000)
|
||||
chanPoint := ht.OpenChannel(
|
||||
alice, bob, lntest.OpenChannelParams{Amt: chanAmt},
|
||||
)
|
||||
ht.OpenChannel(alice, bob, lntest.OpenChannelParams{Amt: chanAmt})
|
||||
|
||||
// Now that the channel is open, create an invoice for Bob which
|
||||
// expects a payment of 1000 satoshis from Alice paid via a particular
|
||||
@@ -638,17 +636,6 @@ func testListPayments(ht *lntest.HarnessTest) {
|
||||
|
||||
// Check that there are no payments after test.
|
||||
ht.AssertNumPayments(alice, 0)
|
||||
|
||||
// TODO(yy): remove the sleep once the following bug is fixed.
|
||||
// When the invoice is reported settled, the commitment dance is not
|
||||
// yet finished, which can cause an error when closing the channel,
|
||||
// saying there's active HTLCs. We need to investigate this issue and
|
||||
// reverse the order to, first finish the commitment dance, then report
|
||||
// the invoice as settled.
|
||||
time.Sleep(2 * time.Second)
|
||||
|
||||
// Close the channel.
|
||||
ht.CloseChannel(alice, chanPoint)
|
||||
}
|
||||
|
||||
// testPaymentFollowingChannelOpen tests that the channel transition from
|
||||
@@ -698,19 +685,6 @@ func testPaymentFollowingChannelOpen(ht *lntest.HarnessTest) {
|
||||
// Send payment to Bob so that a channel update to disk will be
|
||||
// executed.
|
||||
ht.CompletePaymentRequests(alice, []string{bobPayReqs[0]})
|
||||
|
||||
// TODO(yy): remove the sleep once the following bug is fixed.
|
||||
// When the invoice is reported settled, the commitment dance is not
|
||||
// yet finished, which can cause an error when closing the channel,
|
||||
// saying there's active HTLCs. We need to investigate this issue and
|
||||
// reverse the order to, first finish the commitment dance, then report
|
||||
// the invoice as settled.
|
||||
time.Sleep(2 * time.Second)
|
||||
|
||||
// Finally, immediately close the channel. This function will also
|
||||
// block until the channel is closed and will additionally assert the
|
||||
// relevant channel closing post conditions.
|
||||
ht.CloseChannel(alice, chanPoint)
|
||||
}
|
||||
|
||||
// testAsyncPayments tests the performance of the async payments.
|
||||
@@ -818,11 +792,6 @@ func runAsyncPayments(ht *lntest.HarnessTest, alice, bob *node.HarnessNode,
|
||||
ht.Log("\tBenchmark info: Elapsed time: ", timeTaken)
|
||||
ht.Log("\tBenchmark info: TPS: ",
|
||||
float64(numInvoices)/timeTaken.Seconds())
|
||||
|
||||
// Finally, immediately close the channel. This function will also
|
||||
// block until the channel is closed and will additionally assert the
|
||||
// relevant channel closing post conditions.
|
||||
ht.CloseChannel(alice, chanPoint)
|
||||
}
|
||||
|
||||
// testBidirectionalAsyncPayments tests that nodes are able to send the
|
||||
@@ -930,11 +899,6 @@ func testBidirectionalAsyncPayments(ht *lntest.HarnessTest) {
|
||||
// Next query for Bob's and Alice's channel states, in order to confirm
|
||||
// that all payment have been successfully transmitted.
|
||||
assertChannelState(ht, bob, chanPoint, bobAmt, aliceAmt)
|
||||
|
||||
// Finally, immediately close the channel. This function will also
|
||||
// block until the channel is closed and will additionally assert the
|
||||
// relevant channel closing post conditions.
|
||||
ht.CloseChannel(alice, chanPoint)
|
||||
}
|
||||
|
||||
func testInvoiceSubscriptions(ht *lntest.HarnessTest) {
|
||||
@@ -951,9 +915,7 @@ func testInvoiceSubscriptions(ht *lntest.HarnessTest) {
|
||||
|
||||
// Open a channel with 500k satoshis between Alice and Bob with Alice
|
||||
// being the sole funder of the channel.
|
||||
chanPoint := ht.OpenChannel(
|
||||
alice, bob, lntest.OpenChannelParams{Amt: chanAmt},
|
||||
)
|
||||
ht.OpenChannel(alice, bob, lntest.OpenChannelParams{Amt: chanAmt})
|
||||
|
||||
// Next create a new invoice for Bob requesting 1k satoshis.
|
||||
const paymentAmt = 1000
|
||||
@@ -1055,16 +1017,6 @@ func testInvoiceSubscriptions(ht *lntest.HarnessTest) {
|
||||
|
||||
// At this point, all the invoices should be fully settled.
|
||||
require.Empty(ht, settledInvoices, "not all invoices settled")
|
||||
|
||||
// TODO(yy): remove the sleep once the following bug is fixed.
|
||||
// When the invoice is reported settled, the commitment dance is not
|
||||
// yet finished, which can cause an error when closing the channel,
|
||||
// saying there's active HTLCs. We need to investigate this issue and
|
||||
// reverse the order to, first finish the commitment dance, then report
|
||||
// the invoice as settled.
|
||||
time.Sleep(2 * time.Second)
|
||||
|
||||
ht.CloseChannel(alice, chanPoint)
|
||||
}
|
||||
|
||||
// assertChannelState asserts the channel state by checking the values in
|
||||
@@ -1151,10 +1103,6 @@ func testPaymentFailureReasonCanceled(ht *lntest.HarnessTest) {
|
||||
ht, ts, cpAB, routerrpc.ResolveHoldForwardAction_FAIL,
|
||||
lnrpc.Payment_FAILED, interceptor,
|
||||
)
|
||||
|
||||
// Finally, close channels.
|
||||
ht.CloseChannel(alice, cpAB)
|
||||
ht.CloseChannel(bob, cpBC)
|
||||
}
|
||||
|
||||
func sendPaymentInterceptAndCancel(ht *lntest.HarnessTest,
|
||||
|
||||
Reference in new issue
Block a user