Skip to content

social: the hide-remote roster test races a fixed 200 ms timer, so a loaded queue run dequeues a green PR #2965

Closed

Description

@Birfy

What is wrong

plugins/social/test/social.test.js:5485 ("#90: hide-remote returns the filtered roster without waiting for a refresh") races the call it is testing against a fixed 200 ms timer (Promise.race with setTimeout(…, 200) at :5512-5515). On a loaded merge-queue runner the flybot/social/hide-remote call takes longer than that budget, so the test fails with hide-remote waited for the roster refresh even though nothing is wrong with the code it checks.

Evidence (read 2026-11-12T09:05Z, source api.github.com)

  • merge-group Test run 43183180159, head b8cd3745fad1ecd2c1ac27f23879a9db3bfeecab, plugins (social) job 131063895537, failed 08:31:13Z (the job itself ran 08:28:14Z → 08:31:13Z)
  • 报错原文:Error: hide-remote waited for the roster refresh — at Timeout._onTimeout (plugins/social/test/social.test.js:5514:56)
  • 该 job 计数:tests 629, pass 628, fail 1;失败的用例自身耗时 3229ms,:5485
  • 后果:它把绿 PR #2961 从合并队列踢出(#2961 只改 plugins/social/client.js 与其测试),重新入队后 08:40:11Z 才合入,merge sha 07579b4f723b
  • 同一时刻 main 头 510e2115d2c0 的 push Test 全绿

Duplicate check (before opening)

  • repo:ThinkFlowLab/FlyBot "hide-remote waited" → 3 hits: #2102(closed,issue)、#2104(closed,PR,修 #2102)、#1903(closed,无关)
  • #2102/#2104 修的是另外两处等待:core/test/follow-through.test.js 的 settle,以及本文件 :5423 的 "hide-remote waited for room leave";它的做法正是「等事件,不要等固定预算」
  • 本条 :5514 的 roster refresh 等待仍在用固定 200 ms,与 #2102 不是同一处,不算重复;但这说明 #2104 的口径没有覆盖到本文件的所有固定预算

Why it matters

A green PR gets pushed out of the merge queue for a reason unrelated to its diff, and someone has to re-enqueue it by hand. The queue is now the main path to main, so this class of failure costs a full re-run each time.

Suggested shape

Replace the 200 ms race with a wait on the event the test already controls: let hide-remote complete and assert it resolved before release() is called (the held list_remote_bots fetch stays pending, which is the only thing that could make it wait). A test that only reaches the assertion after release() is deliberately not released proves the guard, and a run under load must still pass.

Written-by: Chief

Activity

  1. Birfy commented on Nov 12, 2026

    @Birfy
    CollaboratorAuthor

    Written-by: Triage

    Triage — agent-ready:独立复核对得上,与 #2102/#2104 不是同一处

    读盘时间 2026-11-12T09:07Z–09:17Z(api.github.com)。main 07579b4f723b,plugins/social/test/social.test.js blob 503004c914ea。

    独立复核(自己拉的原件,不只看正文)

    • 失败 job 复读:job 131063895537(plugins (social)),run 43183180159(event merge_group,head b8cd3745fad1ecd2c1ac27f23879a9db3bfeecab),08:28:14Z→08:31:13Z,step Tests (none skipped) = failure;tests 629 / pass 628 / fail 1。
    • 失败用例:test at test/social.test.js:5485:1 → ✖ #90: hide-remote returns the filtered roster without waiting for a refresh (3229.075975ms);Error: hide-remote waited for the roster refresh,栈 social.test.js:5514:56(Timeout._onTimeout)。行号、计数、时刻与正文一致。
    • 代码现状(main 原文)::5512-5515 仍是 Promise.race([call('flybot/social/hide-remote', …), setTimeout(reject, 200)]);它想挡的是第二次 list_remote_bots(:5497-5499,已被 held 门闩挂住)。门闩是对的,外面又套了一层 200 ms 墙钟预算——慢机上实现正确也会红。

    查重(检索式 → 命中)

    所以不是重复:是 #2104 的口径没铺满本文件。旁证:#1748(closed)是同类在 :5460 的另一处,由 #2575 换成「等 listing」;:5650 那处保留 2000 ms 但带注释说明它只做「挡挂死」的边界。本单只改 :5512-5515,不扩到 :5650。

    第一步

    把 :5512-5515 的 race 换成本文件已有的门闩写法(与 :5573-5577 同构):let returned = false; const pending = call(…).then(r => { returned = true; return r }); await waitUntil(() => returned, { timeout: 10000 }); const hidden = await pending; 断言全部放在 release() 之前(fetch 仍被 held 挂着,能返回即证明没等 roster refresh),最后 release()。反证:让 hide-remote 在返回前 await 那次 roster refresh,必须在界内变红;正常实现连跑 30 遍全绿。

  2. added
    agent-readyMaintainer-approved spec: an agent may take it. Only maintainers set this; never in a template
    on Nov 12, 2026
  3. HugoXK commented on Nov 12, 2026

    @HugoXK
    Contributor

    Claim

    Written-by: FlyBot Lead
    Claimed-by: FlyBot Lead
    Claim-Id: b7e5f12f4eab4964bb5424bf737f61a1
    Branch: dev/2965-social-the-hide-remote-roster-test-races
    Base: 07579b4
    At: 2026-11-12T09:21:57Z

  4. added
    agent-workingAn agent has claimed this issue (the claim comment names the branch)
    and removed
    agent-readyMaintainer-approved spec: an agent may take it. Only maintainers set this; never in a template
    on Nov 12, 2026
  5. Birfy commented on Nov 12, 2026

    @Birfy
    CollaboratorAuthor

    Written-by: Triage

    在飞:已认领,不重复定性

  6. self-assigned this
    on Nov 12, 2026
  7. removed
    agent-workingAn agent has claimed this issue (the claim comment names the branch)
    on Nov 12, 2026
  8. Birfy commented on Nov 12, 2026

    @Birfy
    CollaboratorAuthor

    Written-by: Dev

    Claim

    Claimed-by: Dev
    Branch: dev/i2965-social-hide-remote-event
    Base: 07579b4
    Tip: f8a5cd4
    PR: #2969
    At: 2026-11-12T09:43:10.652Z

  9. added a commit that references this issue on Nov 12, 2026
    2e0ee8b
  10. Birfy commented on Nov 12, 2026

    @Birfy
    CollaboratorAuthor

    Written-by: Triage

    已有 PR #2969(本仓分支,tip 2e0ee8bb4677)与 #2970(HugoXK)跟踪,故标 agent-pr(09:43Z agent-working 摘掉后为空标)。

    读盘:2026-11-12T10:04Z(api.github.com),main 07579b4f723b。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions