Hacktoberfest 2026: le issue che i maintainer hanno segnato per ottobre, aperte e adatte ai principianti. Sfoglia le issue Hacktoberfest

Remove the sleep-based lease setup from the two Redis reaper tests

Chiusa Adatta ai principianti
#72 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub

I maintainer di solito rispondono entro 1 giorno

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
2/5
Tempo stimato
1-3 ore
Idoneità per principianti
92/100
Tipo di issue
Refactoring
Chiarezza
Specificata chiaramente
Stato di attività
Attiva
Stack tecnologico
python, redis

Direzione di ricerca

Inizia in tests/backends/test_redis.py con test_running_reaper__fails_expired_tasks e test_stale_acknowledge__is_noop. Leggi l’helper _expire_lease(backend, task_id) a livello di modulo e i test di reap esistenti che lo usano, quindi sostituisci la configurazione della scadenza basata su sleep in entrambi i test. Esegui i due test indicati e conferma che passino senza gli sleep di 1,1 secondi.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

side quest test yeet

Found during the SuperJoe review of the lease-expiry retry patch (4ec9068..d5a1fdb). It is out of the scope of that patch because both tests predate it.

tests/backends/test_redis.py still expires a lease with a sleep of 1.1 seconds:

# tests/backends/test_redis.py
time.sleep(1.1)

# Run the broker to reap the running set
broker = RedisBroker(backend)
broker.main()

The two tests are test_running_reaper__fails_expired_tasks and test_stale_acknowledge__is_noop.

The patch added the module-level _expire_lease(backend, task_id) helper. The helper sets the running-set score back to 0. Every new reap test already uses it. Both old tests can use it too. Then the suite loses about 2.2 seconds of wall clock and the risk of a timing flake.

Lingua principale
Python
Stelle
19
Fork
1
Merge medio
9h 46m
PR unite (30g)
17

Preparare l'ambiente

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di codingjoe/threadmill

Tutte le issue di codingjoe/threadmill

Issue simili

Altre issue su Python

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.