Skip to content

Fix the web and desktop e2e flakes at their causes - #310

Merged
yansfil merged 8 commits into
mainfrom
fix/linux-e2e-flakes
Oct 1, 2026
Merged

yansfil merged 8 commits into
mainfrom
fix/linux-e2e-flakes

Conversation

@yansfil

@yansfil yansfil commented Oct 1, 2026 •

Copy link
Copy Markdown
Contributor

Related: #231, with-hide/hide-private#104, #308, #311

Summary

Linux web e2e와 desktop e2e에서 브랜치와 무관하게 빨개지던 flake를 원인별로 정리합니다.
고친 것: Projects 목록의 fold(프로젝트/체크아웃)가 마지막 snapshot 기준의 "집합"으로 전송되어 빠른 두 번째 클릭이 첫 번째를 덮어쓰던 제품 결함, 러너 화면 높이에 따른 desktop 창 크기 가드.
원인을 못 찾은 것은 격리해 이슈에 근거를 남기고, desktop은 다음 실패가 원인을 말하도록 진단 로그를 추가했습니다.

대상 원인 처리
projects-sidebar.spec.ts:97 ui_state_update가 fold 집합을 stale snapshot에서 계산해 통째로 전송 고침 (제품)
desktop new-tab.spec.ts:68 창 1024x700 요구, 러너 작업영역 높이 681 고침 (fitWindow)
agent-close-contract.spec.ts:13 대체 셸이 layout에 배치되지 않음 (원인 미상) @flaky + #231 + 로그
sidebar-menus.spec.ts:79 새 탭이 탭 스트립에 안 나옴 (원인 미상) @flaky + #308
desktop browser.spec.ts:671 세 번 다른 단계에서 실패 (원인 미상) @flaky + #311 + 진단 로그 2종, desktop job에 격리 step 추가
sidebar-width.spec.ts:43 건드리지 않음 -

Review

  • 판단해 주세요: ui_state_update는 이제 collapsed_workspace_ids, expanded_checkout_ids, expanded_agent_pane_ids를 읽지도 쓰지도 않습니다 (이전 클라이언트가 보내도 무시).
  • 판단해 주세요: pr.yml desktop job이 web 레인과 같은 격리 step을 갖습니다 (필수 step은 --grep-invert @flaky, 둘째 step은 --no-deps --grep @flaky, continue-on-error). --no-deps가 없으면 @needs-focus 테스트가 background 프로젝트 전체를 끌고 옵니다.
  • 조심해서 볼 파일: herdr-core/src/runtime/events.rs - 새 이벤트 project_checkouts_fold, checkout_agents_toggle와 ui_state_update 필드 제거 (snapshot wire 채널).
  • 조심해서 볼 파일: web/src/actions.ts - updateUiState가 fold 필드를 더 이상 싣지 않음.
  • 조심해서 볼 파일: .github/workflows/pr.yml - 새 step의 if와 artifact 업로드 조건.
  • 조심해서 볼 파일: desktop/src/main/browser.ts - 로그 추가만, 동작 변경 없음.

Evidence

  • 확인한 것: 서버-페이지 WebSocket에 20 ms 지연을 주면 수정 전 projects-sidebar.spec.ts:97이 6/6 실패 (같은 ui_state_update가 두 번 나감).
  • 확인한 것: 같은 조건 수정 후 20 ms, 60 ms 지연 각 4/4 통과, 실제 spec은 busy loop 14개 부하에서 8/8 통과, 폴드를 다루는 관련 web spec 11개 통과.
  • 확인한 것: verify-cargo.sh test 전체(1099 중 gh fixture 1개는 부하에서 한 번 실패, 재실행 통과), verify-web.sh(777+81 테스트), verify-cargo.sh lint, no-attribution/workstation 검사 통과.
  • 확인하지 못한 것: agent-close-contract:13(12/12), sidebar-menus:79(8/8 부하, 지연 30/100 ms 각 4/4)는 macOS 로컬에서 재현되지 않았습니다. 원인은 모르고 근거는 Six web e2e specs fail intermittently on the macos-15 CI runners #231 댓글과 #308에 있습니다.
  • 확인하지 못한 것: desktop 변경(fitWindow, 진단 로그)은 @needs-focus 때문에 이 Mac에서 실행하지 않았고 CI가 증거입니다. fitWindow가 browser.spec:671 실패와 같은 원인이라는 증거는 없습니다 (실패 단계가 다름: 793, 774).
  • 확인하지 못한 것: sidebar-width.spec.ts:43은 같은 원인인지 확인하지 못했습니다.
추가 증거
  • browser.spec:671 세 실패: run 36898497112 두 번은 blur 후 창 복귀 단계(793, window.once("focus") 한 번 시도), main run 36905666917은 두 번째 Control-Tab에서 overlay 없음(774). #304이 기다리는 focus() helper 단계가 아닙니다. 새 browser.window_return, browser.cycle_start_refused 이벤트가 호스트 쪽 거절/되돌림을 구분합니다.
  • 실패 run 36895866164의 hided 로그: replacement_failed: The replacement shell could not be placed가 pane close 20 ms 뒤에 기록.

The Projects list folds were sent as whole sets inside ui_state_update, computed from the shell's last snapshot. Two toggles sent before the first one's snapshot arrived (or any unrelated whole-state save carrying a stale copy) overwrote each other, so a chevron clicked twice ended folded, and a stale usage hint or width save could reopen a fold. Folds are now the core's: project_checkouts_fold (flip, or set with expanded) and checkout_agents_toggle apply against the core's own set, and ui_state_update no longer reads or writes collapsed_workspace_ids, expanded_checkout_ids or expanded_agent_pane_ids.

Refs #288
…d hold returns

The area cycle native spec fails at the window-return step (browser.spec.ts:793), not in the focus() helper the earlier fix waits in: the host refocuses the page once on the window's focus event and nothing says whether that attempt was refused or taken back afterwards. The event names which, so the next CI failure is decisive.
…ork area

new-tab.spec asked for a 1024x700 window and failed its bounds check when a runner's usable screen was 681 high; browser.spec carried a second copy of the same guard. fitWindow in fixture.ts keeps the width a layout needs whole, caps the height at the work area's, and asserts what macOS granted, so the 'screen cannot hold the window' guard lives in one place.
…shell is not placed

agent-close-contract.spec.ts:13 failed on Linux (main push 8e44db5, shard 1/8) with close_pane sent and the pane still present after 5 s: hided logged replacement_failed 'The replacement shell could not be placed' 20 ms after the pane close, and nothing recorded why the new tab was missing from the layout. It did not reproduce in 12 runs under 20 busy loops. The core now logs whether the tab was in the projection and had a layout read; the spec runs on the non-blocking @flaky step under #231 until that names the cause.

Refs #231
A tab created from the project menu stayed out of the tab strip for 20 s on one Linux run (PR #305, shard 6). It did not reproduce locally under CPU load or a delayed WebSocket; the spec runs on the non-blocking @flaky step until the cause is named.

Refs #308
browser.spec.ts:671 failed a third time on main at a different step (the second Control-Tab showed no overlay). The host started no hold and recorded nothing; the event names whether the page was visible, held native focus and sat in the key window.
…at cannot block verify

The desktop job gets the web lane's shape: the required step skips @flaky, and a second step runs the quarantined tests once with continue-on-error and its own output directory, uploading the logs on its failure too. --no-deps keeps a @needs-focus test from pulling the whole background project in with it.

Refs #311
@yansfil
yansfil merged commit bd93d83 into main Oct 1, 2026
19 checks passed
@yansfil
yansfil deleted the fix/linux-e2e-flakes branch October 1, 2026 19:01
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