Hacktoberfest 2026:维护者为十月标记出来的 issue,仍然开放、适合新手。 浏览 Hacktoberfest issue

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

已关闭 适合新手
#72 0 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看

维护者通常 1 天内回复

还没有人认领这个 Issue。

评估

难度
2/5
预计耗时
1-3 小时
新手友好度
92/100
Issue 类型
重构
描述清晰度
描述清楚
活跃度
活跃
技术栈
python, redis

调研方向

从 tests/backends/test_redis.py 中的 test_running_reaper__fails_expired_tasks 和 test_stale_acknowledge__is_noop 开始。阅读模块级 helper _expire_lease(backend, task_id) 以及使用它的现有 reap 测试,然后替换两个测试中基于 sleep 的过期设置。运行上述两个测试,并确认它们在不使用 1.1 秒 sleep 的情况下通过。

由索引模型根据 Issue 内容生成。

描述

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.

主要语言
Python
星标
19
派生
1
平均合并
14 小时 37 分钟
30 天内合并 PR
22

环境准备

  • 没有 Dockerfile 或 Docker Compose 文件
  • 没有 Pull Request 模板
  • 阅读贡献指南

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

codingjoe/threadmill 的其他 Issue

查看 codingjoe/threadmill 的全部 Issue

相似的 Issue

更多 Python Issue

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。