agentop tui: TestSearchDoc_RenderIsLinearInALongLine is flaky on shared CI runners

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

维护者通常 1 天内回复

还没有人认领这个 Issue。

评估

难度
2/5
预计耗时
1-3 小时
新手友好度
78/100
Issue 类型
缺陷
描述清晰度
描述清楚
活跃度
活跃
技术栈
go
领域
testing-qa

调研方向

从 cmd/agentop/tui/searchdoc_test.go 和 TestSearchDoc_RenderIsLinearInALongLine 开始,它们分别在 3,000 次和 12,000 次重复中测量 render 的耗时。选择一种建议的方法,在降低对共享 runner 敏感性的同时保留检测二次增长的能力,然后运行聚焦的 Go 测试和 Go CI (authbridge agentop) 作业。完成标准是:在 runner 负载变化时测试不再出现偶发失败,但仍会因二次渲染导致的约 16 倍增长而失败。

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

描述

TestSearchDoc_RenderIsLinearInALongLine (cmd/agentop/tui/searchdoc_test.go) times render on a line of 3,000 and of 12,000 repetitions, takes the best of 3 runs of each, and fails when 4x the line takes more than 8x the time.

On a busy runner, that ratio can pass 8 when nothing is wrong. On #2164, which doesn't touch the search doc code, "Go CI (authbridge agentop)" failed with:

searchdoc_test.go:129: 4x the line took 8.5x the time (132ms → 1.12s): render is not linear

The same job's earlier red on another PR (#2157) is very likely the same test.

Why it flakes: the two sizes are timed at different moments, so a noisy neighbour that slows only the second measurement inflates the ratio. Three runs of each aren't enough to filter that out.

Possible fixes, any one of which keeps catching the regression the test exists for (a quadratic render shows about 16x for 4x the line):

  • loosen the bound to about 12x, which is still well below a quadratic's 16x;
  • interleave the measurements (small, large, small, large…) and take the best of more runs, say 7, so both sizes see the same load;
  • check how the work grows instead of the time: count the operations or allocations of render, which don't depend on the runner;
  • move the timing to a benchmark, and keep only a correctness test in CI.

Assisted-By: Claude (Anthropic AI) [email protected]

主要语言
Go
星标
31
派生
49
平均合并
9 小时 43 分钟
30 天内合并 PR
367

环境准备

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

从这里开始

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

rossoctl/cortex 的其他 Issue

查看 rossoctl/cortex 的全部 Issue

相似的 Issue

更多 Go Issue

把新 issue 发到你的邮箱

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