Skip to content

Commit e3a0587

Browse files
committed
sweepbatcher: fix TestPresigned/dust_main_output
The Problem: The test TestPresigned/dust_main_output was causing a deadlock. When the test called batcher.AddSweep for the second time (with a valid sweep), the batcher would create a new batch and attempt to register for a spend notification. However, the test was not waiting for or consuming this notification registration, leading to a blocked goroutine and a timeout. The Fix: I have added a line to the test to consume the spend notification registration from the mock lnd's channel, similar to how other tests in the same file are structured. This prevents the deadlock. The problem was introduced in commit 54652dc.
1 parent 00cc90b commit e3a0587

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

sweepbatcher/sweep_batcher_presigned_test.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1503,6 +1503,10 @@ func testPresigned_presigned_group_with_dust_main_output(t *testing.T,
15031503
Notifier: &dummyNotifier,
15041504
})
15051505
require.NoError(t, err)
1506+
1507+
// Since a batch was created we check that it registered for its primary
1508+
// sweep's spend.
1509+
<-lnd.RegisterSpendChannel
15061510
}
15071511

15081512
// testPresigned_presigned_group_with_dust_below_relay_fee passes a tx with a

0 commit comments

Comments
 (0)