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

Flaky test AbstractDbCacheTest::testSetMultiple

未关闭
#97 0 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看

还没有人认领这个 Issue。

评估

难度
2/5
预计耗时
1-3 小时
新手友好度
45/100
Issue 类型
缺陷
描述清晰度
基本清楚
活跃度
停滞
技术栈
php

调研方向

从 tests/Common/AbstractDbCacheTest.php 中第170-179行附近和第553行开始,然后运行针对性的 Oracle DbCacheTest::testSetMultiple 测试。检查测试如何处理一秒的缓存过期精度,并验证在不削弱过期行为的情况下,时间边界处的失败已被消除。

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

描述

type:test

Sometimes fails due to time lag.

..F............................................................  63 / 124 ( 50%)
.............................................................   124 / 124 (100%)

Time: 00:23.671, Memory: 22.00 MB

There was 1 failure:

1) Yiisoft\Cache\Db\Tests\Driver\Oracle\DbCacheTest::testSetMultiple with data set #1 (2)
Failed asserting that null matches expected 1.

/home/runner/work/cache-db/cache-db/tests/Common/AbstractDbCacheTest.php:553
/home/runner/work/cache-db/cache-db/tests/Common/AbstractDbCacheTest.php:177

Test code:
https://github.com/yiisoft/cache-db/blob/aa6a67f4d8b712e8251e5451e18cf7631d5748f6/tests/Common/AbstractDbCacheTest.php#L170-L179

Cache expire precision is 1 second, so

  • 1.99: execute setMultiple with ttl = 2 -> expire is set to 3 (time() = 1 + 2 seconds)
  • 2.00: execute get -> ok,
  • 2.09: execute get -> ok
  • …
  • 3.00: execute get -> fail
主要语言
PHP
星标
13
派生
9
平均合并
9 分钟
30 天内合并 PR
1

环境准备

从这里开始

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

yiisoft/cache-db 的其他 Issue

查看 yiisoft/cache-db 的全部 Issue

相似的 Issue

更多 PHP Issue

把新 issue 发到你的邮箱

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