mirror of
https://github.com/lightningnetwork/lnd.git
synced 2025-02-23 06:35:07 +01:00
itest: fix flake in testAnchorThirdPartySpend
When mining lots of blocks in the itest, the subsystems can be out of sync in terms of the best block height. We now assert the num of pending sweeps on Alice's node to give her more time to sync the blocks, essentially behaving like a `time.Sleep` as in reality, the blocks would never be generated this fast.
This commit is contained in:
parent
baa34b06d3
commit
e4b205cd90
1 changed files with 7 additions and 1 deletions
|
@ -564,7 +564,13 @@ func testAnchorThirdPartySpend(ht *lntest.HarnessTest) {
|
|||
//
|
||||
// TODO(yy): also check the restart behavior of Alice.
|
||||
const anchorCsv = 16
|
||||
ht.MineEmptyBlocks(anchorCsv - defaultCSV)
|
||||
blocks := anchorCsv - defaultCSV
|
||||
|
||||
// Mine empty blocks and check Alice still has the two pending sweeps.
|
||||
for i := 0; i < blocks; i++ {
|
||||
ht.MineEmptyBlocks(1)
|
||||
ht.AssertNumPendingSweeps(alice, 2)
|
||||
}
|
||||
|
||||
// Now that the channel has been closed, and Alice has an unconfirmed
|
||||
// transaction spending the output produced by her anchor sweep, we'll
|
||||
|
|
Loading…
Add table
Reference in a new issue