Repository navigation
Port web e2e fixture cleanup, compile and local sockets to Windows - #432
Merged
Merged
Conversation
…shim compile per worker The hided fixture removed its directory, the pane shells' home, before Herdr's panes had exited, which Windows refuses with EBUSY. Herdr's stop now removes it after their processes are gone. Compile each fixture C source once per worker instead of once per test, count a pane shell's children with a compiled helper instead of a PowerShell start, and spell the stream a fixture listens or connects on, the executable names and the process usage the way each system does.
The desktop provider fixture passed a source path to the text-taking compile, and its cleanup unit test pinned the old layout. A failed Herdr stop now still runs the queued directory removals and reports them beside its own failure.
spawnAgent and the specs' own agent start calls ran the moment a prompt was drawn, and Herdr refuses a shell that still has a descendant. Only setup waited, so a test that got past setup failed at its first spawnAgent.
… zero children Herdr starts an agent only while the pane's shell alone holds the terminal, as pane process-info reports it. A Windows shell can keep a resident child that is not in the foreground, so counting children never reached zero. Wait on the reported condition as the product does, treat a busy refusal (nothing typed) as a reason to keep waiting within the same bound, and name the shell's children when it fails.
yansfil
added a commit
that referenced
this pull request
Oct 5, 2026
…436) Related: #432(머지됨, 이 PR의 `fixtureProgram`이 쓰는 worker당 1회 컴파일이 거기 있다). nightly Windows web e2e 실패 G1e. ## Summary Windows에서 가짜 `gh`, `tailscale`, 사용량 provider가 실행되지 않아 PR, 이슈, 사용량, 모바일 화면이 비던 12건 중 9건의 원인을 고친다. 제품 코드는 바뀌지 않는다. - 원인(코드로 확인): 가짜 실행 파일이 `#!/bin/sh` 스크립트라 Windows가 이름으로 실행하지 못하고, `PATH`를 `:`로 이어 드라이브 문자(`C:`)가 갈라졌다. 그래서 daemon이 `gh`를 못 찾았다. - `fixtureProgram`(`web/e2e/platform-fixture.ts`): 가짜마다 Node 스크립트 하나. Windows는 `compileFixtureC`로 worker당 한 번 컴파일한 런처 하나를 `name.exe`로 복사해 같은 이름의 `name.js`를 실행한다. 가짜마다 C를 따로 쓰지 않는다. - `checkout-pr`, `sidebar-pr-start`, `cmdk`, `overview`, `overview-prs`, `weekly-usage`, `mobile`의 가짜를 옮겼고 `PATH`는 `path.delimiter`로 잇는다. ## Review - **조심해서 볼 파일**: `web/e2e/platform-fixture.ts` - C 런처(인자 전달, 종료 코드, 경로 따옴표). Windows에서 컴파일해 본 적은 CI뿐이다. - **판단해 주세요**: 아래 "확인하지 못한 것"의 `/usage` 환경 문제를 제품 결함으로 볼지. - **질문**: 없음. ## Evidence - **확인한 것**: web typecheck, lint 통과. macOS에서 `fixtureProgram`이 만든 가짜가 인자를 받고 종료 코드를 돌려주는 것을 실행해 확인. 옮긴 스크립트는 지운 sh와 줄 단위로 대조 리뷰했다. - **확인하지 못한 것**: Windows 실행. 고친 spec 7개(checkout-pr, sidebar-pr-start, cmdk, overview, overview-prs, weekly-usage, mobile)에는 `@platform` 태그가 없어 PR의 Windows lane이 돌리지 않는다. Windows web e2e 전체는 required가 아니고, Linux/macOS 무회귀는 이 PR의 lane이 확인한다. - **머지 뒤 확인 조건**: 머지 뒤 첫 scheduled nightly(18:00Z)의 Windows에서 대상 9건(spec 7개의 test 9건)을 확인한다. 새로 깨진 것이 있으면 revert 또는 즉시 수정한다. - **확인하지 못한 것**: `weekly-usage`는 `/usage` 자식이 `HOME PATH USER LOGNAME TMPDIR`만 받아(`hide-ai/src/claude.rs` `USAGE_ENVIRONMENT`) Windows의 node가 `SystemRoot` 없이 시작하지 못할 수 있다. 진짜 Claude CLI도 Node라 같은 위험이 제품에 있다. CI 결과로 확인하고, 실패하면 별도 결정으로 올린다. - **확인하지 못한 것**: G1e 12건 중 `start-panel`, `agent-sleep`, `s8`은 셸 스크립트와 무관하다(s8은 session 행 label에 native `C:\` 경로, 앞의 둘은 agent 시작/잠들기가 Windows에서 안 됨). 이 PR 범위 밖이고 원인은 따로 조사한다. - `worktree-removing-menu.spec.ts`의 `#!/bin/sh` 가짜 `git`은 G1e 목록에 없어 그대로 둔다.
yansfil
added a commit
that referenced
this pull request
Oct 5, 2026
Related: #470(이 원인으로 생긴 flaky issue), #432. `desktop/e2e/fixture-cleanup.unit.ts`가 #466과 같은 파일을 만져서 #466이 머지되면 main을 한 번 merge한다. ## Summary e2e fixture의 C 프로그램을 test 안에서 컴파일하지 않고 진입점에서 한 번 빌드한다. 같은 결정(test 안 컴파일 20초 bound)을 두 번째로 고치는 것이라 bound가 아닌 상태(빌드 산출물)로 옮겼다. - 원인(main e38f935 Windows, job 111628184913): 첫 컴파일이 cold라 20초를 넘겼고, 죽인 clang의 자식이 남아 worker가 5분 동안 끝나지 않았다. - Playwright `globalSetup`(`web/e2e/global-setup.ts`, web과 desktop 설정이 같이 씀)이 `web/e2e/shims/*.c`를 한 번 컴파일해 `web/.e2e-shims/<이름>-<소스 해시>`(gitignore)에 둔다. test는 완성된 프로그램을 복사만 한다(`copyFixtureShim`). - 산출물이 없거나 컴파일이 실패하면 컴파일러 이름과 그 출력(컴파일러가 못 뜨면 그 오류)으로 즉시 실패한다. 기본값이나 건너뛰기는 없다. - spawn provider는 실행마다 달라지는 값(Herdr 경로, 완료 파일, 명령)을 소스에 박던 것을 `$HIDE_E2E_ROOT/provider.config`로 읽게 바꿨다. `HIDE_E2E_ROOT`는 fixture의 Herdr 서버 env에 있어 서버가 만드는 모든 pane(hided가 만든 자식 pane 포함)이 받는다. - C 소스는 TS 문자열에서 `.c` 파일로 옮겼다(내용 동일; 옛 hide-open 겸용 분기만 별도 `noop.c`로 분리). ## Review - **조심해서 볼 파일**: `web/e2e/shims/build.ts` - 해시 이름, 부분 파일(`.pid.partial`) 정리, 동시 빌드(web과 desktop globalSetup) 처리. - **조심해서 볼 파일**: `web/e2e/shims/spawn-provider.c`의 `load_config` - 새로 쓴 부분은 이것뿐이고 나머지는 이동이다. - **질문**: 없음. ## Evidence - **지워진 것**: `compileFixtureC`, worker별 캐시, 프로세스 종료 시 정리(exit hook), 20초 bound, test 안 컴파일러 호출. - **크기(D3, 파일/줄)**: fixture 3개(`platform-fixture.ts` 250→168, `herdr-fixture.ts` 894→732, `agent-spawn-fixture.ts` 352→119) 1,496줄 → 1,019줄. 새로 생긴 것: `shims/build.ts` 60, `global-setup.ts` 7, C 5개 475줄(이동 약 400 + 설정 읽기 약 40). 파일 3개 → 11개, 줄 합계 1,496 → 1,561(+65, 거의 이동). 새 장치는 진입점 하나(`globalSetup`)다. - **확인한 것**: web·desktop typecheck, lint(크기 상한 기준선 그대로), `fixture-cleanup.unit.ts` 5개(복사 대상 `noop`과 위치 단언 포함). macOS에서 build 진입점 동작: 첫 빌드 369 ms, 둘째 1 ms, 부재 시 안내 메시지, 복사 후 실행 권한. 로컬에서 `playwright test e2e/shell.spec.ts:137`을 돌려 `globalSetup`이 실제로 `.e2e-shims`를 만드는 것을 확인했다. - **확인하지 못한 것**: Windows 실행(clang 컴파일, `launcher`/`hide-children` 복사). 로컬 e2e는 이 worktree에 `hided` 빌드가 없어(로컬 cargo 빌드 금지) test 본문까지는 못 돌렸다. 이 PR의 Linux/macOS/Windows PR lane이 확인한다. Windows web e2e는 `@platform` 일부만 PR lane에서 돌아, 전체 효과는 머지 뒤 첫 nightly에서 본다. - 리뷰 subagent의 Fix now 3건(자식 pane에 `HIDE_E2E_ROOT` 없음, 다른 빌드의 부분 파일 삭제, 컴파일러 시작 실패 사유 누락)을 반영했다. Follow-up 중 `getenv`가 Windows ANSI(비ASCII 임시 경로)이고 cwd 상대 경로 가정이 남았다.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Related: nightly Windows web e2e 실패 G1c, G1d, G1f. 같은 fixture 파일을 고치는 R6a(
ci/windows-e2e-shell-path, PR 전)와 hunk가 겹치지 않아 main 위에서 시작했다. G1e는 별도 PR로 이어진다.Summary
Windows web e2e의 결정적 fixture 실패를 원인에서 고친다. 제품 코드는 바뀌지 않는다.
EBUSY rmdir: hided fixture가 pane 셸의 작업 폴더가 든 디렉터리를 Herdr pane 프로세스가 끝나기 전에 지웠다. 이제 Herdr stop이 프로세스를 정리한 뒤 지운다(afterStop). 재시도는 늘리지 않았다.clang.exe20초 초과: test마다 같은shim.c를 컴파일했다. worker당 한 번 컴파일하고 복사한다. 상한은 그대로다./bin/ps는processUsage, 로컬 소켓은localEndpoint(Windows는\\.\pipe\<path>),bin\codex복사는fixtureExecutable.digit-hintsETIMEDOUT은 PowerShell CIM 시작이 setup 기한을 넘긴 것이어서 컴파일한hide-children.exe(ToolHelp32)로 바꿨다.Review
web/e2e/herdr-fixture.ts- 종료 순서(afterStop)와 실패 경로: 실패해도 대기 중인 정리를 모두 돌리고 첫 실패 옆에 보고한다.web/e2e/platform-fixture.ts-compileFixtureC가 소스 경로 대신 소스 텍스트를 받는다. 호출자는 web 두 곳, desktop 한 곳이다.Evidence
확인한 것: web·desktop typecheck와 lint 통과.
desktop/e2e/fixture-cleanup.unit.ts5개 통과(macOS). 컴파일 캐시는 macOS에서 첫 호출 129 ms, 둘째 0 ms로 확인했다.확인하지 못한 것: Windows 실행은 CI에서만 본다. nightly dispatch 결과(아래)가 나오면 갱신한다. 이 PR의 Linux와 macOS web e2e 통과가 같은 spec의 회귀 없음을 말한다.
agent_pane_busy(close-subtree:337): Port web e2e fixture cleanup, compile and local sockets to Windows #432 때문이 아니라 기존 원인이 드러난 것이다. main의 같은 test는 setup의 PowerShell ETIMEDOUT에서 먼저 죽었고, 이 PR이 그 단계를 고치자spawnAgent의agent start가 Herdr 거절을 만났다. 1차 수정(자식 0개 대기)은 틀렸다: 셸에 상주 자식이 남아1 children으로 시간 초과(job 111594984784). Herdr가 거절하는 조건은 문서에 있다(docs/ARCHITECTURE.mdStarting an agent, v0.9.1available_pane_shell_from_job): 셸의 foreground process group이 셸 자신뿐일 때만 시작한다. 그래서 fixture가pane process-info가 그 상태를 말할 때만agent start를 보내고(제품의start_at_shell과 같다), 거절(agent_pane_busy, 아무것도 입력되지 않음)은 같은 10초 안에서 다시 기다린다. 기한은 늘리지 않았고, 실패하면 마지막 process info와 셸의 자식 목록(이름, pid)을 메시지에 싣는다. 자식의 정체는 다음 Windows 실행 결과로 확인한다.확인하지 못한 것: G1e(가짜
gh/provider가 POSIX 스크립트) 12건은 이 PR 범위 밖이다.nightly dispatch: https://github.com/modakbul-gongbang/hide/actions/runs/37250876208 (이 브랜치, 결과 대기 중)