From e3a0587dfec8e8e919d52dd7d65306222067ad73 Mon Sep 17 00:00:00 2001 From: Boris Nagaev Date: Sun, 28 Sep 2025 18:05:47 -0300 Subject: [PATCH] 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 54652dc6415cf202993f73a9224a6fbbb2dd4fcc. --- sweepbatcher/sweep_batcher_presigned_test.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/sweepbatcher/sweep_batcher_presigned_test.go b/sweepbatcher/sweep_batcher_presigned_test.go index a38496279..c31aaf902 100644 --- a/sweepbatcher/sweep_batcher_presigned_test.go +++ b/sweepbatcher/sweep_batcher_presigned_test.go @@ -1503,6 +1503,10 @@ func testPresigned_presigned_group_with_dust_main_output(t *testing.T, Notifier: &dummyNotifier, }) require.NoError(t, err) + + // Since a batch was created we check that it registered for its primary + // sweep's spend. + <-lnd.RegisterSpendChannel } // testPresigned_presigned_group_with_dust_below_relay_fee passes a tx with a