AI-generated analysisPublished automatically and not human-verified. Validated context appears in community notes below.
← Watch feed
Informational 15 Bitcoin

pytest: fix flake in tests/test_bookkeeper.py::test_bookkeeping_missed_chans_leases

Public commit record

What the developer wrote

Authored by Rusty Russell

83/100 · Strong
pytest: fix flake in tests/test_bookkeeper.py::test_bookkeeping_missed_chans_leases

```
FAILED tests/test_bookkeeper.py::test_bookkeeping_missed_chans_leases - AssertionError: assert [{'tag': 'channel_open', 'credit_msat': 506268000, 'debit_msat': 0}, {'tag': 'lease_fee', 'credit_msat': 0, 'debit_msat': 6268000}, {'tag': 'invoice', 'credit_msat': 0, 'debit_msat': 11000000}, {'tag': 'onchain_fee', 'credit_msat': 1314000, 'debit_msat': 0}] == [{'tag': 'channel_open', 'credit_msat': 506268000, 'debit_msat': 0}, {'tag': 'lease_fee', 'credit_msat': 0, 'debit_msat': 6268000}, {'tag': 'onchain_fee', 'credit_msat': 1314000, 'debit_msat': 0}, {'tag': 'invoice', 'credit_msat': 0, 'debit_msat': 11000000}]

At index 2 diff: {'tag': 'invoice', 'credit_msat': 0, 'debit_msat': 11000000} != {'tag': 'onchain_fee', 'credit_msat': 1314000, 'debit_msat': 0}

Full diff:
[
{
'credit_msat': 506268000,
'debit_msat': 0,
'tag': 'channel_open',
},
{
'credit_msat': 0,
'debit_msat': 6268000,
'tag': 'lease_fee',
},
{
+ 'credit_msat': 0,
+ 'debit_msat': 11000000,
+ 'tag': 'invoice',
+ },
+ {
'credit_msat': 1314000,
'debit_msat': 0,
'tag': 'onchain_fee',
},
- {
- 'credit_msat': 0,
- 'debit_msat': 11000000,
- 'tag': 'invoice',
- },
]
```

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
✓ Specific, descriptive subject✓ Names a concrete action or component✓ Provides detailed explanatory context✓ Mentions testing or verification
The short version

What changed, and why it matters

This commit fixes a flaky test in the bookkeeper accounting module. The test sometimes failed because two events (an invoice payment and an on-chain fee) had timestamps so close together that their order could vary. The fix adds a short delay and waits for the payment to fully settle before checking the accounting records. There is no security issue here.

Recommended action

No security action needed. This is a test reliability fix; review and merge as normal.

Security signals we found

No strong security signals were identified.

Risk score

Why this scored 15/100

Our methodology →
Potential impact 0/30
Exploitability 0/25
Stealth signal 0/15
Affected reach 0/15
Confidence 10/10
Evidence quality 5/5
Human-validated context

Community notes

Notes can correct, qualify, or add evidence to the AI analysis. Every note shown here has been validated by a human moderator.

No validated notes yet.

The AI analysis stands alone for now. Submit a note if you can add evidence or important context.