Test suite trips LNbits rate limiter (429) when run in one pass #44

Open
opened 2026-06-12 18:40:24 +00:00 by padreug · 0 comments
Owner

Symptom

Running the full suite in a single pytest invocation, the alphabetically-last test files (test_settlement_api.py, test_void_reject_api.py) error in fixture setup:

AssertionError: grant permission failed: 429 {"error":"Rate limit exceeded: 200 per 1 minute"}

All affected tests pass when their file is run in isolation. The full suite (~120 tests in ~25s) simply exceeds LNbits' default 200 per 1 minute slowapi limit from 127.0.0.1.

Fix

Raise/disable the rate limit in the test session — conftest's settings fixture should set the relevant settings field (e.g. lnbits_rate_limit_no / lnbits_rate_limit_unit, whatever the dev branch exposes) so the suite isn't load-order sensitive. One-line change once the right knob is identified.

Observed 2026-06-12 running the suite against lnbits/dev per tests/README.md.

🤖 Generated with Claude Code

## Symptom Running the full suite in a single pytest invocation, the alphabetically-last test files (`test_settlement_api.py`, `test_void_reject_api.py`) error in fixture setup: ``` AssertionError: grant permission failed: 429 {"error":"Rate limit exceeded: 200 per 1 minute"} ``` All affected tests pass when their file is run in isolation. The full suite (~120 tests in ~25s) simply exceeds LNbits' default `200 per 1 minute` slowapi limit from 127.0.0.1. ## Fix Raise/disable the rate limit in the test session — conftest's `settings` fixture should set the relevant settings field (e.g. `lnbits_rate_limit_no` / `lnbits_rate_limit_unit`, whatever the dev branch exposes) so the suite isn't load-order sensitive. One-line change once the right knob is identified. Observed 2026-06-12 running the suite against lnbits/dev per tests/README.md. 🤖 Generated with [Claude Code](https://claude.com/claude-code)
Sign in to join this conversation.
No labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
aiolabs/libra#44
No description provided.