Commit 233742c
committed
chancloser: stabilize remote RBF coop tests
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.1 parent 096ab65 commit 233742c
1 file changed
+13
-8
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
684 | 684 | | |
685 | 685 | | |
686 | 686 | | |
687 | | - | |
| 687 | + | |
688 | 688 | | |
689 | 689 | | |
690 | 690 | | |
| |||
696 | 696 | | |
697 | 697 | | |
698 | 698 | | |
699 | | - | |
| 699 | + | |
| 700 | + | |
| 701 | + | |
700 | 702 | | |
701 | 703 | | |
702 | 704 | | |
| |||
1386 | 1388 | | |
1387 | 1389 | | |
1388 | 1390 | | |
1389 | | - | |
1390 | 1391 | | |
1391 | 1392 | | |
1392 | | - | |
| 1393 | + | |
| 1394 | + | |
| 1395 | + | |
| 1396 | + | |
| 1397 | + | |
1393 | 1398 | | |
1394 | 1399 | | |
1395 | 1400 | | |
| |||
1857 | 1862 | | |
1858 | 1863 | | |
1859 | 1864 | | |
1860 | | - | |
| 1865 | + | |
1861 | 1866 | | |
1862 | 1867 | | |
1863 | 1868 | | |
| |||
1867 | 1872 | | |
1868 | 1873 | | |
1869 | 1874 | | |
1870 | | - | |
| 1875 | + | |
1871 | 1876 | | |
1872 | 1877 | | |
1873 | 1878 | | |
| |||
1950 | 1955 | | |
1951 | 1956 | | |
1952 | 1957 | | |
1953 | | - | |
| 1958 | + | |
1954 | 1959 | | |
1955 | 1960 | | |
1956 | 1961 | | |
| |||
2048 | 2053 | | |
2049 | 2054 | | |
2050 | 2055 | | |
2051 | | - | |
| 2056 | + | |
2052 | 2057 | | |
2053 | 2058 | | |
2054 | 2059 | | |
| |||
0 commit comments