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:
yyforyongyu
2024-10-29 16:48:23 +08:00
parent 00772ae281
commit 72f3f41d41
33 changed files with 47 additions and 447 deletions

View File

@@ -156,7 +156,6 @@ func testSphinxReplayPersistence(ht *lntest.HarnessTest) {
Amt: chanAmt,
},
)
defer ht.CloseChannel(fred, chanPointFC)
// Now that the channel is open, create an invoice for Dave which
// expects a payment of 1000 satoshis from Carol paid via a particular
@@ -225,9 +224,6 @@ func testSphinxReplayPersistence(ht *lntest.HarnessTest) {
// unaltered.
ht.AssertAmountPaid("carol => dave", carol, chanPoint, 0, 0)
ht.AssertAmountPaid("dave <= carol", dave, chanPoint, 0, 0)
// Cleanup by mining the force close and sweep transaction.
ht.ForceCloseChannel(carol, chanPoint)
}
// testListChannels checks that the response from ListChannels is correct. It
@@ -420,12 +416,6 @@ func testMaxPendingChannels(ht *lntest.HarnessTest) {
chanPoints[i] = fundingChanPoint
}
// Next, close the channel between Alice and Carol, asserting that the
// channel has been properly closed on-chain.
for _, chanPoint := range chanPoints {
ht.CloseChannel(alice, chanPoint)
}
}
// testGarbageCollectLinkNodes tests that we properly garbage collect link
@@ -464,7 +454,7 @@ func testGarbageCollectLinkNodes(ht *lntest.HarnessTest) {
dave := ht.NewNode("Dave", nil)
ht.ConnectNodes(alice, dave)
persistentChanPoint := ht.OpenChannel(
ht.OpenChannel(
alice, dave, lntest.OpenChannelParams{
Amt: chanAmt,
},
@@ -537,9 +527,6 @@ func testGarbageCollectLinkNodes(ht *lntest.HarnessTest) {
"did not expect to find bob in the channel graph, but did")
require.NotContains(ht, channelGraph.Nodes, carol.PubKeyStr,
"did not expect to find carol in the channel graph, but did")
// Now that the test is done, we can also close the persistent link.
ht.CloseChannel(alice, persistentChanPoint)
}
// testRejectHTLC tests that a node can be created with the flag --rejecthtlc.
@@ -566,14 +553,14 @@ func testRejectHTLC(ht *lntest.HarnessTest) {
ht.FundCoins(btcutil.SatoshiPerBitcoin, carol)
// Open a channel between Alice and Carol.
chanPointAlice := ht.OpenChannel(
ht.OpenChannel(
alice, carol, lntest.OpenChannelParams{
Amt: chanAmt,
},
)
// Open a channel between Carol and Bob.
chanPointCarol := ht.OpenChannel(
ht.OpenChannel(
carol, bob, lntest.OpenChannelParams{
Amt: chanAmt,
},
@@ -636,10 +623,6 @@ func testRejectHTLC(ht *lntest.HarnessTest) {
)
ht.AssertLastHTLCError(alice, lnrpc.Failure_CHANNEL_DISABLED)
// Close all channels.
ht.CloseChannel(alice, chanPointAlice)
ht.CloseChannel(carol, chanPointCarol)
}
// testNodeSignVerify checks that only connected nodes are allowed to perform
@@ -654,9 +637,8 @@ func testNodeSignVerify(ht *lntest.HarnessTest) {
// Create a channel between alice and bob.
cfgs := [][]string{nil, nil}
chanPoints, nodes := ht.CreateSimpleNetwork(cfgs, p)
_, nodes := ht.CreateSimpleNetwork(cfgs, p)
alice, bob := nodes[0], nodes[1]
aliceBobCh := chanPoints[0]
// alice signs "alice msg" and sends her signature to bob.
aliceMsg := []byte("alice msg")
@@ -684,9 +666,6 @@ func testNodeSignVerify(ht *lntest.HarnessTest) {
require.False(ht, verifyResp.Valid, "carol's signature didn't validate")
require.Equal(ht, verifyResp.Pubkey, carol.PubKeyStr,
"carol's signature doesn't contain alice's pubkey.")
// Close the channel between alice and bob.
ht.CloseChannel(alice, aliceBobCh)
}
// testAbandonChannel abandons a channel and asserts that it is no longer open
@@ -702,7 +681,7 @@ func testAbandonChannel(ht *lntest.HarnessTest) {
// Create a channel between alice and bob.
cfgs := [][]string{nil, nil}
chanPoints, nodes := ht.CreateSimpleNetwork(cfgs, channelParam)
alice, bob := nodes[0], nodes[1]
alice := nodes[0]
chanPoint := chanPoints[0]
// Now that the channel is open, we'll obtain its channel ID real quick
@@ -755,11 +734,6 @@ func testAbandonChannel(ht *lntest.HarnessTest) {
// Calling AbandonChannel again, should result in no new errors, as the
// channel has already been removed.
alice.RPC.AbandonChannel(abandonChannelRequest)
// Now that we're done with the test, the channel can be closed. This
// is necessary to avoid unexpected outcomes of other tests that use
// Bob's lnd instance.
ht.ForceCloseChannel(bob, chanPoint)
}
// testSendAllCoins tests that we're able to properly sweep all coins from the