Hacktoberfest 2026: as issues que os mantenedores marcaram para outubro, abertas e boas para iniciantes. Ver issues do Hacktoberfest

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

Aberta Para iniciantes
#72 0 comentários 0 reações 0 responsáveis Ver no GitHub

Mantenedores costumam responder em até 1 dia

Ninguém assumiu esta issue ainda.

Avaliação

Dificuldade
2/5
Tempo estimado
1-3 horas
Facilidade para iniciantes
92/100
Tipo de issue
Refatoração
Clareza
Claramente especificada
Status de atividade
Ativa
Stack de tecnologia
python, redis
Domínio
backend, testing-qa

Direção de pesquisa

Comece em tests/backends/test_redis.py com test_running_reaper__fails_expired_tasks e test_stale_acknowledge__is_noop. Leia o helper _expire_lease(backend, task_id) no nível do módulo e os testes de reap existentes que o utilizam, depois substitua a configuração de expiração baseada em sleep em ambos os testes. Execute os dois testes mencionados e confirme que eles passam sem os sleeps de 1,1 segundo.

Escrita pelo modelo de indexação a partir do texto da issue.

Descrição

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.

Linguagem predominante
Python
Estrelas
17
Forks
1
Merge médio
2h 31min
PRs com merge (30d)
16

Preparar o ambiente

Primeiros passos

  1. Leia a issue inteira e depois o guia de contribuição do projeto.
  2. Comente na issue dizendo que vai assumir — evita que duas pessoas façam o mesmo trabalho.
  3. Faça um fork do repositório e trabalhe em uma branch.
  4. Abra um pull request que referencie o número da issue.

Mais de codingjoe/threadmill

Todas as issues de codingjoe/threadmill

Issues semelhantes

Mais issues de Python

Receba novas issues na sua caixa de entrada

Um resumo curto de issues do GitHub para quem está começando.