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

regtest: make extract_preimage less flaky

Public commit record

What the developer wrote

Authored by f321x

90/100 · Strong
regtest: make extract_preimage less flaky

Wait until the lnpay screen commands in the `extract_preimage`
regtest return before checking their log output to prevent a race
where the preimage becomes available but the log doesn't yet contain
the success string.

```
***** test_extract_preimage ******
initializing alice
funding alice
a6f8f660a3bab3c4af636849dae55f4c7d5d483289a5812c7efce19f4c701753
initializing bob
funding bob
b51eae095f875c7a796e74d87d6e4c21d42348272159ee30bd81ce7d9f18defe
mining 1 blocks
starting daemon (PID 5040)
/tmp/alice/regtest/wallets/default_wallet
true
starting daemon (PID 5060)
/tmp/bob/regtest/wallets/default_wallet
true

alice opens channel
7cde6dcba2a0d033ecd40c1c7cb8eec4c554acb1a09099eb1206ba39a93728ae:1
mining 3 blocks
wait until alice sees channel open.
wait until alice sees channel open..
wait until alice sees channel open...
0caecfe64e319771d60f6f1e488f28d64667783432a15fccab534dfffb2096a4
mining 1 blocks
wait until alice has preimage for c217931809c870a8032d536e59ccf2399a5d96b937818c64ae60c7e7d5363728.
wait until alice has preimage for c217931809c870a8032d536e59ccf2399a5d96b937818c64ae60c7e7d5363728..
wait until alice has preimage for c217931809c870a8032d536e59ccf2399a5d96b937818c64ae60c7e7d5363728...
wait until bob has preimage for c53556db6fcffcb2dd7c6b215e94d1af9c96e42c7170ae11e47b03a929917f28.
bob payment failed
Daemon stopped
Daemon stopped
......F
======================================================================
FAIL: test_extract_preimage (tests.regtest.TestLightningAB)
```
✓ Descriptive subject✓ Names a concrete action or component✓ Provides detailed explanatory context✓ Explains rationale or failure mode✓ Mentions testing or verification
The short version

What changed, and why it matters

This commit fixes a flaky automated test, not a security bug in the Electrum wallet. It adds a wait step so the test script doesn't check log files before background payment commands have finished writing to them. There is no change to production code or user-facing behavior.

Recommended action

No security action needed. Treat as a normal test reliability improvement.

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.