mirror of
https://github.com/lightningnetwork/lnd.git
synced 2025-03-26 01:33:02 +01:00
itest+lntest: fix flake in coopCloseWithHTLCsWithRestart
Previously we'd restart Alice and then restart Bob, which means once Alice is shut down and started again before we shut down Bob, Bob will attempt to connect Alice since the connection is permanent, which could put the node in a weird state. We now make sure both nodes are shut down first, then bring them back online to avoid the above case. We may, however, create another test in the future to check the above case if needed.
This commit is contained in:
parent
a067aa45ef
commit
e0296083ca
@ -196,11 +196,14 @@ func coopCloseWithHTLCsWithRestart(ht *lntest.HarnessTest) {
|
||||
ht.AssertChannelInactive(bob, chanPoint)
|
||||
ht.AssertChannelInactive(alice, chanPoint)
|
||||
|
||||
// Now restart Alice and Bob.
|
||||
ht.RestartNode(alice)
|
||||
ht.RestartNode(bob)
|
||||
// Shutdown both Alice and Bob.
|
||||
restartAlice := ht.SuspendNode(alice)
|
||||
restartBob := ht.SuspendNode(bob)
|
||||
|
||||
ht.AssertConnected(alice, bob)
|
||||
// Once shutdown, restart and connect them.
|
||||
require.NoError(ht, restartAlice())
|
||||
require.NoError(ht, restartBob())
|
||||
ht.EnsureConnected(alice, bob)
|
||||
|
||||
// Show that both nodes still see the channel as waiting for close after
|
||||
// the restart.
|
||||
|
@ -401,7 +401,7 @@ func (h *HarnessTest) assertChannelStatus(hn *node.HarnessNode,
|
||||
}, DefaultTimeout)
|
||||
|
||||
require.NoErrorf(h, err, "%s: timeout checking for channel point: %v",
|
||||
hn.Name(), cp)
|
||||
hn.Name(), h.OutPointFromChannelPoint(cp))
|
||||
|
||||
return channel
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user