Skip to content

Fix force close balance flake - #1239

Merged
tnull merged 3 commits into
lightningdevkit:mainfrom
tnull:2026-11-fix-force-close-balance-flake
Nov 17, 2026
Merged

tnull merged 3 commits into
lightningdevkit:mainfrom
tnull:2026-11-fix-force-close-balance-flake

Conversation

@tnull

@tnull tnull commented Nov 17, 2026

Copy link
Copy Markdown
Collaborator
`settle_force_close_balance` asserted that the sweeper tracks the
closed channel's output right after the sync that matured it. However,
the output only reaches the sweeper once the `SpendableOutputs` event
was handled in the background, and its sweep is only broadcast on a
subsequent sync. On a slow CI runner the check could hence run while
the funds were no longer a lightning balance and not yet a pending
sweep balance, failing `channel_full_cycle_force_close`.

We now keep syncing until the sweeper reports the sweep as broadcast
before checking the balances.
`connection_restart_behavior` slept for five seconds each time it
waited for a connection to be established, i.e., 20 seconds per run,
even though the peers usually connect right away.

We now poll the peer lists instead and only keep the fixed wait where
the test checks that no reconnect happens, as that can't be polled for.

`settle_force_close_balance` asserted that the sweeper tracks the
closed channel's output right after the sync that matured it. However,
the output only reaches the sweeper once the `SpendableOutputs` event
was handled in the background, and its sweep is only broadcast on a
subsequent sync. On a slow CI runner the check could hence run while
the funds were no longer a lightning balance and not yet a pending
sweep balance, failing `channel_full_cycle_force_close`.

We now keep syncing until the sweeper reports the sweep as broadcast
before checking the balances.

Co-Authored-By: HAL 9000
`connection_restart_behavior` slept for five seconds each time it
waited for a connection to be established, i.e., 20 seconds per run,
even though the peers usually connect right away.

We now poll the peer lists instead and only keep the fixed wait where
the test checks that no reconnect happens, as that can't be polled for.

Co-Authored-By: HAL 9000
@tnull tnull added this to the 0.8 milestone Nov 17, 2026
@tnull
tnull requested a review from jkczyz November 17, 2026 08:44
@ldk-reviews-bot

ldk-reviews-bot commented Nov 17, 2026 •

Copy link
Copy Markdown

👋 Thanks for assigning @jkczyz as a reviewer!
I'll wait for their review and will help manage the review process.
Once they submit their review, I'll check if a second reviewer would be helpful.

Comment thread tests/integration_tests_rust.rs Resolved
The persisted-peer branch of the connection restart test asserted node
A's connection state twice and never checked node B's, so a missing
reconnect on B's side would not have been caught by that assertion.

Assert on node B's peer details instead, as originally intended.

Co-Authored-By: HAL 9000
@tnull
tnull merged commit a5a50f5 into lightningdevkit:main Nov 17, 2026
14 of 27 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants