Skip to content

retired-bot-paths.test.js:591 断言依赖时序,CI 上间歇性红 #1833

Closed

Description

@Birfy

Written-by: Chief

core/test/retired-bot-paths.test.js:591(#1786 那条「a retired Bot is not brought along by a lagging review」)在 CI 上不稳定:同一 tip 本地 22/22 全绿,CI 上 tests-ok 与 ubuntu-latest · Node 24 · DSH 0.2.0-rc.2 都红在这一条。

  • 首次观察:PR Add Project roles and the host-checked role switch #1832、tip 7a83dc9612f74c726b3436f95c4c1fac573349b2(2026-10-30T12:08Z 前后的 CI 运行)。
  • 期望 ["b3","m1"],实际 ["m1"]。
  • 该 tip 的改动只碰 project 的 roles 与客户端,没有碰 review/memory 路径,所以这是断言本身依赖时序,不是那笔改动引入的。

原因判断(断言写法):用了 waitFor + 固定次数 settle() 去等第二次 memoryReviewRequest,在 memoryReviewDelayMs: 0 下事件循环调度不同步就少一次请求。要的是确定性条件,不是再等一会儿。

修法:把断言改成等条件成立——等 requests.length >= 2(或等第二个 memoryReviewRequest 的 promise/resolve)再断言,去掉固定 settle 次数;保留原有语义(退休 Bot 不应被滞后的 review 带回来)。

验收:node --test core/test/retired-bot-paths.test.js 连跑 10 次全绿(for i in $(seq 10); do node --test core/test/retired-bot-paths.test.js || break; done);同一个 PR 上 CI tests-ok 绿。

注:PR #1832 的 Reviewer 已要求在该 PR 内把这条断言改成确定性写法,所以本单先作为记录;若那个 PR 未修就合入,再按本单派实现线。

Activity

  1. added
    bugSomething isn't working
    agent-readyMaintainer-approved spec: an agent may take it. Only maintainers set this; never in a template
    area:automationScheduled tasks and automation
    on Oct 30, 2026
  2. Birfy commented on Oct 30, 2026

    @Birfy
    CollaboratorAuthor

    Written-by: Triage

    Triage check at main tip 7d216900b264945b01b09da03beb4e24cec944f0 (2026-10-30T12:36Z):

  3. self-assigned this
    on Oct 30, 2026
  4. added
    agent-workingAn agent has claimed this issue (the claim comment names the branch)
    on Oct 30, 2026
  5. Birfy commented on Oct 30, 2026

    @Birfy
    CollaboratorAuthor

    Written-by: Claim

    Claimed #1833 — branch dev/1833-retired-bot-timing, first step: replace the waitFor + fixed settle() pair at core/test/retired-bot-paths.test.js:582-592 with a deterministic wait on the second memoryReviewRequest, then regenerate the patch mirror.

  6. removed
    agent-workingAn agent has claimed this issue (the claim comment names the branch)
    on Oct 30, 2026
  7. removed
    agent-readyMaintainer-approved spec: an agent may take it. Only maintainers set this; never in a template
    on Oct 30, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

area:automationScheduled tasks and automationbugSomething isn't working

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions