Deflake CI E2E failures (#3311)
## Summary
- Deflake CI E2E failures from
https://github.com/dyad-sh/dyad/actions/runs/25126503338.
- Await streamed token-usage persistence before token-count invalidation
so the context-limit banner sees the real max token usage.
- Harden E2E helpers around GitHub sync completion, already-applied
proposals, queued Lexical submissions, visual-save button re-renders,
and Windows line endings.
- Update the component-tagger upgrade snapshot from 0.8.0 to 0.9.0.
## Root Cause
The failing run had several independent races and one stale snapshot:
- The context-limit banner could refetch token counts before the
assistant message's max token usage had been saved, leaving
actualMaxTokens null after a high-token stream.
- GitHub assertions snapshotted the connected-repo panel while the sync
button was still in its transient Syncing state.
- Some E2E helpers used one-shot Lexical fills/clicks where Playwright
can act during React or DOM replacement windows.
- The code-editor assertion compared raw file contents, which fails on
Windows CRLF output.
- The select-component upgrade snapshot still expected the older
component tagger version.
## Why This Fix Is Correct
- Awaiting the existing max-token update makes the later chat/token
invalidations observe the persisted usage instead of racing it.
- GitHub sync waits now use the stable connected-repo panel state:
Syncing hidden, Sync to GitHub enabled, and the panel-local success text
visible.
- Queued-message and visual-save actions now retry the exact UI contract
the tests require: the queued row appears or the save button is visible,
enabled, and clickable.
- The editor test normalizes only line endings, preserving the
file-content assertion while making it platform-independent.
## Test Plan
- npm run fmt && npm run lint:fix && npm run ts
- PYTHON=/usr/bin/python3 npm run build
- PLAYWRIGHT_HTML_OPEN=never npm run e2e --
e2e-tests/select_component.spec.ts --update-snapshots
- PLAYWRIGHT_HTML_OPEN=never npm run e2e --
e2e-tests/context_limit_banner.spec.ts e2e-tests/debugging_logs.spec.ts
e2e-tests/edit_code.spec.ts e2e-tests/github.spec.ts
e2e-tests/queued_message.spec.ts e2e-tests/visual_editing.spec.ts
- First run: 21 passed, 6 GitHub helper strict-mode failures due
duplicate success toast text.
- PLAYWRIGHT_HTML_OPEN=never npm run e2e -- e2e-tests/github.spec.ts
- npm test
🤖 Generated with [Claude Code](https://claude.com/claude-code)
<!-- devin-review-badge-begin -->
---
<a href="https://app.devin.ai/review/dyad-sh/dyad/pull/3311"
target="_blank">
<picture>
<source media="(prefers-color-scheme: dark)"
srcset="https://static.devin.ai/assets/gh-open-in-devin-review-dark.svg?v=1">
<img
src="https://static.devin.ai/assets/gh-open-in-devin-review-light.svg?v=1"
alt="Open in Devin Review">
</picture>
</a>
<!-- devin-review-badge-end -->
---------
Co-authored-by:
Will Chen <7344640+wwwillchen@users.noreply.github.com>
正在显示
请
注册
或者
登录
后发表评论