Skip to content

End MSVC's telemetry helper before the first Windows e2e test - #559

Merged
yansfil merged 1 commit into
mainfrom
fix/flaky-549
Oct 5, 2026
Merged

yansfil merged 1 commit into
mainfrom
fix/flaky-549

Conversation

@yansfil

@yansfil yansfil commented Oct 5, 2026

Copy link
Copy Markdown
Contributor

Refs #549

Summary

Windows e2e에서 startAgentAtShell이 "the shell of pane w1:p2 never held the terminal alone before agent start"로 실패하던 원인을 없앱니다. e2e 실행이 첫 test 전에 MSVC 도구가 남긴 telemetry helper(vctip.exe)를 끝냅니다.

  • 원인:
    • MSVC의 compiler와 linker는 build 뒤에도 vctip.exe를 남깁니다. 이 job의 cargo build 단계도 남겼고, runner가 job 끝에 Terminate orphan process: pid (972) (vctip)로 정리했습니다. cargo만 도는 Windows job(windows check, os contract)도 같은 줄을 남깁니다.
    • 그 helper가 기록한 부모 pid는 이미 끝난 linker의 것이고, Windows는 그 pid를 다시 씁니다. 실패한 pane의 cmd.exe(pid 5828)가 그 pid를 받아, hide-children.exe가 shell의 자식으로 972 vctip.exe를 보고했습니다.
    • Herdr 0.9.1의 Windows agent.start(available_pane_shell)는 shell의 자손을 부모 pid만으로 세고 생성 시각을 보지 않습니다. 그래서 pane process-info가 shell 단독이라고 답하는 동안에도 agent_pane_busy로 거절했고, helper가 사는 동안 계속 거절합니다.
  • 수정:
    • web/e2e/platform-fixture.ts endVctip: 이름이 vctip인 process만 끝내고, 각각 끝났는지 handle로 기다려 확인합니다(5초 안에 끝나지 않으면 이름과 함께 실패). 끝낸 pid를 돌려줍니다.
    • web/e2e/global-setup.ts: Windows에서 shim build 뒤에 endVctip을 부르고 끝낸 pid를 log에 남깁니다. globalSetup은 job의 모든 compile(cargo build 단계, shim build) 뒤에 돌고 test는 compile하지 않으므로, 이 한 곳이 두 출처를 모두 덮습니다.
    • docs/TESTING.md: Windows agent start 항목에 이유를 적었습니다.

Review

  • 판단해 주세요: 개발자의 Windows 기기에서 e2e를 돌려도 vctip.exe를 끝냅니다. telemetry helper일 뿐이고 같은 pid 재사용 위험이 로컬에도 있어서 CI로 한정하지 않았습니다.
  • 판단해 주세요: 문서화된 opt-out은 Visual Studio 개선 프로그램의 HKLM registry(SQM\OptIn=0)뿐이고 vctip 실행을 막는다는 말은 없습니다. VSCMD_SKIP_SENDTELEMETRY는 VsDevCmd script의 telemetry용입니다. 그래서 끄는 대신 끝냅니다.
  • 조심해서 볼 파일: web/e2e/global-setup.ts - web과 desktop e2e의 공통 entry point입니다. Windows 밖에서는 동작이 바뀌지 않습니다.

Evidence

  • 확인한 것: 실패 job(37332699952, windows e2e)의 첫 시도 메시지는 shell 단독인 process info, agent_pane_busy 답, children of shell 5828: 972 vctip.exe였습니다. 같은 job 끝 정리에서 vctip pid 972가 유일한 orphan이었습니다.
  • 확인한 것: Herdr v0.9.1 src/platform/windows.rs의 available_pane_shell_from_snapshot은 descendant_entries가 비어 있을 때만 shell을 받고, descendant_entries는 th32ParentProcessID로만 자식을 찾습니다.
  • 확인한 것: e2e fixture 두 파일의 타입 검사, web lint(e2e 크기 예산 포함) 통과.
  • 확인하지 못한 것: Windows에서의 실행. 이 PR의 Windows e2e lane log에 ended vctip.exe <pid> before the first test가 남는지로 확인합니다.

vctip.exe outlives the build that started it and still names an exited
linker as its parent. When Windows gives that pid to a pane's shell, the
pinned Herdr counts the helper as the shell's child and refuses agent start
there as busy. globalSetup now ends every vctip.exe after the run's last
compile, confirms each exited, and prints the pids.
@yansfil
yansfil merged commit 9749fcc into main Oct 5, 2026
27 checks passed
@yansfil
yansfil deleted the fix/flaky-549 branch October 5, 2026 17:29
yansfil added a commit that referenced this pull request Oct 6, 2026
…ms (#603)

Refs #583 #538 #593

## Summary

Three Windows flakes failed the same way inside `startHerdr`: the first
agent start waited ten seconds and Herdr kept answering
`agent_pane_busy` for a shell that held the terminal alone.
In each, the one "child" of the shell was `csrss.exe`: #583 shell 736 ->
748, #538 shell 728 -> 740, #593 shell 7768 -> 7784.
`csrss.exe` names as its parent the `smss.exe` that started it and
exited, Windows gave that pid to the pane's shell, and the pinned Herdr
counts a shell's children by parent pid alone, so the pane refuses
agents for as long as `csrss.exe` runs (until shutdown).
`hide-children.exe` now prints each child's start time and whether it
started before the parent, and `startHerdr` replaces its two panes once
when a process older than a shell names it as parent.

## Review

- **판단해 주세요**: the replacement is a resource swap on a detected state,
not a wait or a retry of the start: it acts only on "a process that
started before the shell names the shell's pid as parent" (start times,
any name), at most once, logs one line, and a claimed replacement fails
setup with each process's pid, start time and name.
- **판단해 주세요 (product)**: a real Windows user whose pane shell gets such
a pid has agent start refused in that pane the same way; Herdr's `agent
start` takes no start time into account, so this is an upstream
candidate.
- **조심해서 볼 파일**: `web/e2e/herdr-fixture.ts` - the new workspace is
opened while the claimed shells still hold their pids, so no new shell
can be given one of them, and the claimed workspace is closed after; the
two agent starts now come after both panes are ready instead of between
them.
- **조심해서 볼 파일**: `web/e2e/shims/hide-children.c` -
`OpenProcess(PROCESS_QUERY_LIMITED_INFORMATION)` and `GetProcessTimes`;
a process Windows does not answer for is `unknown`, never `older`.

## Evidence

- **확인한 것**: the three runs' logs
([37391023049](https://github.com/modakbul-gongbang/hide/actions/runs/37391023049),
[37352769077](https://github.com/modakbul-gongbang/hide/actions/runs/37352769077),
[37403137691](https://github.com/modakbul-gongbang/hide/actions/runs/37403137691))
each fail at `startAgentAtShell` called from `startHerdr`
(herdr-fixture.ts:670) with `children of shell N: M csrss.exe`; the
fourth case of this failure, #549, was `vctip.exe` and #559 already ends
it.
- **확인한 것**: `pnpm --dir web lint` (eslint and the e2e size budget) and
`pnpm --dir desktop typecheck` (which compiles the web fixture through
the desktop e2e) pass.
- **확인하지 못한 것**: the replacement branch itself: it runs only when
Windows hands a shell a claimed pid, which cannot be arranged on a
runner. This run shows the check on every Windows `startHerdr` finding
nothing to replace and the lanes passing; `hide-children.c` compiles
only on Windows, in this run.
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