Skip to content

Commit c24f839

Browse files
committed
itest: fix flake in testSweepHTLCs
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.
1 parent fb91b04 commit c24f839

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

itest/lnd_sweep_test.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -864,13 +864,13 @@ func testSweepHTLCs(ht *lntest.HarnessTest) {
864864
// Carol settles the first invoice.
865865
carol.RPC.SettleInvoice(preimageSettled[:])
866866

867+
// Bob should have settled his outgoing HTLC with Carol.
868+
ht.AssertHTLCNotActive(bob, bcChanPoint, payHashSettled[:])
869+
867870
// Let Carol go offline so we can focus on testing Bob's sweeping
868871
// behavior.
869872
ht.Shutdown(carol)
870873

871-
// Bob should have settled his outgoing HTLC with Carol.
872-
ht.AssertHTLCNotActive(bob, bcChanPoint, payHashSettled[:])
873-
874874
// We'll now mine enough blocks to trigger Bob to force close channel
875875
// Bob->Carol due to his outgoing HTLC is about to timeout. With the
876876
// default outgoing broadcast delta of zero, this will be the same

0 commit comments

Comments
 (0)