Skip to content

Commit

Permalink
itest: fix flake in testSweepHTLCs
Browse files Browse the repository at this point in the history
We need to make sure Caarol finishes settling her invoice with Bob
before shutting down, so we make sure `AssertHTLCNotActive` on Bob
happens before shutting node Carol.
  • Loading branch information
yyforyongyu committed Jan 17, 2025
1 parent fb91b04 commit c24f839
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions itest/lnd_sweep_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -864,13 +864,13 @@ func testSweepHTLCs(ht *lntest.HarnessTest) {
// Carol settles the first invoice.
carol.RPC.SettleInvoice(preimageSettled[:])

// Bob should have settled his outgoing HTLC with Carol.
ht.AssertHTLCNotActive(bob, bcChanPoint, payHashSettled[:])

// Let Carol go offline so we can focus on testing Bob's sweeping
// behavior.
ht.Shutdown(carol)

// Bob should have settled his outgoing HTLC with Carol.
ht.AssertHTLCNotActive(bob, bcChanPoint, payHashSettled[:])

// We'll now mine enough blocks to trigger Bob to force close channel
// Bob->Carol due to his outgoing HTLC is about to timeout. With the
// default outgoing broadcast delta of zero, this will be the same
Expand Down

0 comments on commit c24f839

Please sign in to comment.