Skip to content

fix: keep a rejected HTTP start's failure through the status poll - #440

Merged
guan4tou2 merged 2 commits into
mainfrom
fix/windows-unit-flakes
Oct 24, 2026
Merged

guan4tou2 merged 2 commits into
mainfrom
fix/windows-unit-flakes

Conversation

@guan4tou2

Copy link
Copy Markdown
Owner

問題

Spec 062 的 PR #437 在 Windows unit 上連續失敗四次,每次落在不同檔案;main 最新一次 Windows CI 也失敗了。其中兩個可以從 main 修:

  1. first-run-record-terminal:這其實是產品缺陷。 首次設定的 HTTP 卡片每 3 秒輪詢一次 proxy 狀態,並直接用結果覆蓋卡片狀態。輪詢只知道 proxy「已停止」,不知道這次啟動為什麼失敗,所以啟動失敗的訊息最多 3 秒就被換成一般的啟動按鈕。runner 慢的時候,輪詢會搶在斷言之前發生,這就是測試時好時壞的原因。
  2. terminal-session-rotation:計時門檻太緊。 這個門檻是用來抓「轉換時等待正在執行的指令」,也就是等 sleep 99;但 1000ms 在 Windows runner 上量到 1205ms,轉換本身並沒有錯。

變更

  • HttpCaptureStep:如果目前狀態是帶錯誤訊息的 failed,讀到 stopped 時不覆蓋它;其他狀態照常取代。3 秒輪詢和對焦重新驗證兩處都套用。
  • 新增確定性測試:啟動被拒絕後讓輪詢跑一次,失敗訊息必須還在。這個測試在修正前會失敗,失敗時的畫面文字和 CI 上看到的一致。
  • rotation 的門檻放寬到 5 秒,仍然遠小於 99 秒。

不在這個 PR

  • bundle-export 的 Python verifier 在 Windows 上卡超過 15 秒:這不像單純 runner 慢,可能是 Windows 上真的卡住。沒有 Windows 環境無法查,先不碰。
  • export-attachment-list 失敗的斷言:只存在於 Spec 062 分支,main 上沒有。

驗證

  • 本機 typecheck、verify:specs、verify:architecture、verify:i18n 通過。
  • 兩個被修改的測試檔共 54 項通過。
  • Windows 上是否穩定,以這個 PR 的 CI 結果為準。

🤖 Generated with Claude Code

guan4tou2 and others added 2 commits October 24, 2026 14:54
The first-run HTTP card polls the proxy's status every 3 s and took each
answer whole. A poll that found the proxy merely stopped knows nothing
about why the start failed, so it replaced the failure with a plain
start button: the operator saw the error for at most three seconds.

On a slow runner the poll landed before the test's assertion, which is
why 'a rejected start shows the failure' failed intermittently on
Windows, on main and on PRs. A stopped reading no longer overwrites a
failure with its error; any other state still replaces it.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The guard exists to catch a rotation that waits for running commands,
which here would mean waiting for sleep 99. One second failed on a
Windows runner at 1205 ms while the rotation was correct; five seconds
still tells a wait apart.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@coderabbitai

coderabbitai Bot commented Oct 24, 2026

Copy link
Copy Markdown

Important

  • 🔍 Trigger review

This repository does not receive automatic reviews because it has fewer than 10 stars.

Run configuration
  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: defaults
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 6fd5603f-2876-46e1-9475-637b0972d283
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@guan4tou2
guan4tou2 merged commit a4e1b45 into main Oct 24, 2026
6 checks passed
@guan4tou2
guan4tou2 deleted the fix/windows-unit-flakes branch October 24, 2026 13:53
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