Skip to content

Conversation

@starius
Copy link
Collaborator

@starius starius commented Nov 7, 2025

Change Description

CI started panicking in TestRbfChannelFlushingTransitions/early_offer / TestRbfCloseClosingNegotiationRemote (see GitHub Actions run https://github.com/lightningnetwork/lnd/actions/runs/19155841408/job/54756127218?pr=10352) because the cached remote offer could fire before the test harness registered its mock CloseSigner expectations. When that happened, the mock complained that CreateCloseProposal was unexpected:

panic:
assert: mock: I don't know what to return because the method call was unexpected.

Fix this by letting assertSingleRemoteRbfIteration take a trigger callback. Tests that rely on asynchronously replayed offers now install their expectations first and then fire the event via the callback. All other call sites pass nil, preserving their existing behavior.

Steps to Test

Reproduction (on master)

  1. Modify lnwallet/chancloser/rbf_coop_test.go
  • Add time.Sleep(10 * time.Millisecond) before the first call of closeHarness.assertSingleRemoteRbfIteration (in function TestRbfChannelFlushingTransitions).
  1. go test ./lnwallet/chancloser -run TestRbfChannelFlushingTransitions/early_offer

  2. The panic reproduces immediately.

Pull Request Checklist

Testing

  • Your PR passes all CI checks.
  • Tests covering the positive and negative (error paths) are included.
  • Bug fixes contain tests triggering the bug to prevent regressions.

Code Style and Documentation

📝 Please see our Contribution Guidelines for further guidance.

CI started panicking in TestRbfChannelFlushingTransitions/early_offer /
TestRbfCloseClosingNegotiationRemote (see GitHub Actions run
https://github.com/lightningnetwork/lnd/actions/runs/19155841408/job/54756127218?pr=10352)
because the cached remote offer could fire before the test harness
registered its mock CloseSigner expectations. When that happened,
the mock complained that CreateCloseProposal was unexpected:

panic:
assert: mock: I don't know what to return because the method call was unexpected.

Fix this by letting assertSingleRemoteRbfIteration take a trigger
callback. Tests that rely on asynchronously replayed offers now install
their expectations first and then fire the event via the callback.
All other call sites pass nil, preserving their existing behavior.

Reproduction (on master)
------------------------
1. Modify lnwallet/chancloser/rbf_coop_test.go
   Add time.Sleep(10 * time.Millisecond) before the first call of
   closeHarness.assertSingleRemoteRbfIteration (in function
   TestRbfChannelFlushingTransitions).

2. go test ./lnwallet/chancloser -run TestRbfChannelFlushingTransitions/early_offer

3. The panic reproduces immediately.
@starius starius marked this pull request as ready for review November 7, 2025 06:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant