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

tests: fix flaky test_simple_close_delay_broadcast mempool race

Public commit record

What the developer wrote

Authored by Níckolas Goline

83/100 · Strong
tests: fix flaky test_simple_close_delay_broadcast mempool race

The test mined a block as soon as 'Broadcasting txid' appeared in l2's
log, but that log fires when CLN calls sendrawtransaction, not when
bitcoind has accepted the tx into its mempool. Under rpcproxy timing the
block could be mined empty, leaving the funding output unspent so
'Resolved FUNDING_TRANSACTION/FUNDING_OUTPUT by MUTUAL_CLOSE' never
logged and the test timed out.

Wait for the tx to enter the mempool before generating the block.

Changelog-None
✓ 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 automated test in Core Lightning. The test was sometimes failing because it mined a Bitcoin block immediately after seeing a log message that said a transaction was being broadcast. That log appears when Core Lightning submits the transaction, not when Bitcoin actually accepts it into the memory pool. Under timing variations, the block could be mined before the transaction arrived, producing an empty block and causing the test to time out. The fix waits for the transaction to enter the memory pool before mining. This is a test-only change and does not affect production code or user funds.

Recommended action

No security action required. This is a test reliability fix. Reviewers may optionally verify that generate_block's wait_for_mempool polling behaves correctly under the test framework's rpcproxy setup.

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.