Bernd (Hermes)
|
aa37de3e6e
|
rate-limiting feinschliff: 429-retry, API-call reduction, auto-route detection
AUFGABE 1 — test_03 API-calls reduzieren:
- Skip get_latest_timestamp on source room; use post_message's returned ts as cursor (saves 1 channels.history call)
- Source polling: initial_interval=5s (was 2s), timeout=30s (was 25s)
- Target polling: timeout=60s (was 25s), initial_interval=8s (was 2s)
- post_message() now returns (msg_id, ts) tuple — all call sites updated
AUFGABE 2 — 429-retry strategy verbessern:
- rc_rest.py: 5 retries with 3s/6s/12s/20s/30s backoff (was 3 retries 3s/6s/12s)
- polling.py: 5 consecutive 429s before RateLimitSkip (was 3)
- polling.py: 429 backoff max 30s (was 24s)
AUFGABE 3 — rate-limit-cooldown erhöhen:
- conftest.py: 20s between tests (was 15s)
AUFGABE 4 — test_03 auto-route robustness:
- Detect auto-route (wechseln/sehe dich/thema) vs button-move-request (kopieren/rüber/attachments)
- Auto-route: pytest.skip with reason, no button click, no target verification
- Button-request: proceed with existing button-click + target-verification flow
|
2026-07-28 18:34:07 +02:00 |
|
Bernd (Hermes)
|
57ebbc6d6b
|
rate-limit: zentraler Rate-Limiter in RCRestClient._request() + 429-Retry + 15s Cooldown
AUFGABE 1 — Rate-Limiter in _request():
- RCRestClient.__init__ nimmt optionalen rate_limiter
- _request() ruft rate_limiter.acquire() VOR jedem API-Call auf
- Schützt ALLE Endpoints: postMessage, channels.history, users.info, chat.delete
- rc_client Fixture (session-scoped) injiziert rate_limiter in den Client
AUFGABE 2 — 15s Cooldown zwischen Tests:
- rate_limit_cooldown autouse Fixture in conftest.py
- yield + time.sleep(15) nach jedem Test
- RC Rate-Limit-Window (~10s) wird zuverlässig resettet
AUFGABE 3 — test_03 Skip-Ursache:
- test_02 und test_03 pollen nicht mehr direkt hintereinander ohne Pause
- 15s Cooldown + zentraler Rate-Limiter verhindern kaskadierende 429s
AUFGABE 4 — 429-Retry mit Backoff:
- _request() retryed HTTP 429 mit 3s → 6s → 12s Backoff (max 3 Retries)
- post_message failt nicht mehr sofort bei 429
CLEANUP:
- Redundante rate_limiter.acquire() aus polling.py (wait_for_bot_message,
get_latest_timestamp), conftest.py (post_test_message) und
test_04_multi_room.py entfernt
- rate_limiter Fixture auf session-scope (war eh globaler Singleton)
- Docstrings aktualisiert
|
2026-07-28 18:27:05 +02:00 |
|
Bernd (Hermes)
|
6a09caa1e5
|
feat: REST-basierte Live-Test-Harness für RC-Plugin
Implementiert die vollständige Test-Harness für Rocket.Chat Live-Tests
von .101 (Bernd) gegen .45 (MyTestBot) via REST API.
ARCHITEKTUR:
- tests/live_rc/conftest.py: Fixtures, Marker, Skip-Logik, Self-Check,
Token-Bucket-Rate-Limiter (60 calls/min), Suite-Lock (/tmp/rc-live-tests.lock),
Cleanup-Fixture, Message-Ownership-Assert, Bot-Status-Check
- helpers/rc_rest.py: REST-Client-Wrapper (post, history, users.info, self-check)
- helpers/polling.py: Cursor-basiertes Polling mit Rate-Limiter-Integration
und exponentiellen Backoff bei HTTP 429
TESTS:
- test_01_echo.py: Smoke-Test — Bot antwortet auf einfache Nachricht
- test_02_button_click.py: ::-Text als Button-Klick-Simulation (E3)
- test_03-06: Skeletons mit @pytest.mark.skip
VERIFIZIERT:
- Ohne Env-Variablen: komplettes SKIP, keine Fehler
- Mit Env-Variablen + Bot im Onboarding: SKIP mit klarer Diagnose
- Rate-Limiter verhindert HTTP 429 (vorher: 100% Fehlerrate)
- Self-Check validiert Token/User-Identity vor jedem Lauf
- Suite-Lock verhindert parallele Läufe
|
2026-07-28 13:12:52 +02:00 |
|