Skip to content

test: CollectPanel 站点筛选标签断言等待 useWatch 落地 - #60

Merged
magicapple123 merged 1 commit into
mainfrom
test/collectpanel-usewatch-race
Oct 2, 2026
Merged

magicapple123 merged 1 commit into
mainfrom
test/collectpanel-usewatch-race

Conversation

@magicapple123

Copy link
Copy Markdown
Owner

antd 6 Form.useWatch 订阅通知为异步时序 + React 19 调度,CI Node 20 慢机上数据注入后的重渲染晚于同步断言(#54 合并后 main CI Frontend 作业的 flake)。测试侧加等待,断言值不变。

@magicapple123
magicapple123 merged commit a01d7a8 into main Oct 2, 2026
10 checks passed
@magicapple123
magicapple123 deleted the test/collectpanel-usewatch-race branch October 2, 2026 10:19
magicapple123 added a commit that referenced this pull request Oct 2, 2026
WebFormPage「跨页返回恢复未完成会话」用例在 CI 上偶发失败
(#58 的 Frontend 作业):

    TestingLibraryElementError: Unable to find an accessible element
    with the role "button" and name /结束本次填写/

根因是测试自身的时序竞态,而非 router 7.18.4 的行为变化:

- 「结束本次填写」按钮的渲染门控是 `running && (sessionActive || live?.running)`
  (WebFormPage.tsx),除了 sessionStorage 的会话恢复外,还依赖
  getWebFormBrowserStatus 轮询返回的 running —— 它与「填充到页面」按钮
  不在同一次状态提交里。
- 原断言在 waitFor「填充到页面」出现后**同步** getByRole「结束本次填写」,
  高负载下后者尚未提交即抛错。
- 佐证:router 7.18.3/7.18.4 changelog 无会话恢复相关变更
  (7.18.4 仅 RSC redirect 转义与 #15485 避免 startViewTransition 的时序
  变化);本地 7.18.4 下单文件 15 连跑 + 全量套件均绿,失败只在 CI
  负载下偶发,与 #60 的 useWatch 竞态同类。

修复:两处同步断言改为 findByRole / findByDisplayValue 等待落地,
断言内容(role / name / 值)不变,无放松。

验证:vitest 801/801(123 文件);eslint 0 error / 11 warning(基线);
tsc --noEmit、prettier --check 通过。
magicapple123 added a commit that referenced this pull request Oct 2, 2026
react-router-dom 7.18.4 timing exposes the same class of CI-only race as #60: the "结束本次填写" button renders in a later state commit than the "填充到页面" wait covered (depends on browser-status polling). Two synchronous assertions became findBy* waits — assertion values unchanged. 15 consecutive local runs green on 7.18.4. Fixes the #58 Frontend flake.
magicapple123 added a commit that referenced this pull request Oct 3, 2026
React 19 + antd 6 下面板异步挂载在 CI Node 20 慢机上可能超过 waitFor 默认 1s,previewResumeTemplate 调用数断言放宽到 5s(等的就是正确值,断言本身不变)。与 #60/#62 同类的 CI 时序修正。
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant