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

pytest: fix flake if rune tests are slow.

Public commit record

What the developer wrote

Authored by Rusty Russell

78/100 · Adequate
pytest: fix flake if rune tests are slow.

If one second has passed during testing, checkrune might pass:

```
# default (sec)
rune_per_default = l1.rpc.createrune(restrictions=[["per=1"]])['rune']
assert rune_per_default == 'NrM7go6C4qzfRQDkUSv1DtRroJWSKqdjIOuvGS4TLFE9NCZwZXI9MQ=='
> do_test_rune_per_restriction(l1, rune_per_default, 1)

tests/test_runes.py:269:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

l1 = <fixtures.LightningNode object at 0x7f7344ad2ef0>
rune_to_test = 'NrM7go6C4qzfRQDkUSv1DtRroJWSKqdjIOuvGS4TLFE9NCZwZXI9MQ=='
per_sec = 1

def do_test_rune_per_restriction(l1, rune_to_test, per_sec):
...
# cannot use same rune till 'per_sec' seconds
> with pytest.raises(RpcError, match='Not permitted:') as exc_info:
E Failed: DID NOT RAISE <class 'pyln.client.lightning.RpcError'>

tests/test_runes.py:217: Failed
```

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
✓ 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 only changes test code. It makes a flaky test more reliable by increasing the time window used in rune rate-limit tests from 1 second to 2 seconds, so slow test machines don't accidentally pass a rate-limit check. There is no change to production code or any security fix.

Recommended action

No security action needed; this is a 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.