Skip to content

End what a fixture's Windows processes started after they were listed - #607

Merged
yansfil merged 1 commit into
mainfrom
fix/flaky-581
Oct 6, 2026
Merged

yansfil merged 1 commit into
mainfrom
fix/flaky-581

Conversation

@yansfil

@yansfil yansfil commented Oct 6, 2026 •

Copy link
Copy Markdown
Contributor

Refs #581

Summary

In #581's first attempt, herdr.stop() ended Herdr's tree and everything run from the fixture root, confirmed none was left, and 0.8 s after the server exited rmSync failed with EPERM unlink ...\bin\claude.exe: something still had the fixture's claude.exe loaded.
The fixture lists a process tree while its owner runs, kills the owner, then ends the listed processes; a child the owner starts after the listing is in no list.
hided starts each provider child suspended, puts it in a kill-on-close job, then resumes it (OwnedChild::spawn); killed between the start and the job, the child stays suspended outside any job for good, holding claude.exe. The restarted daemon's log ends on a usage probe of the provider list (codex, then claude) as the test stopped it.
endWindowsProcesses now also ends every process an owned one started, found by parent pid and start time after the owner is gone, and stops what is left on every pass, not only the first.

Review

  • 조심해서 볼 파일: web/e2e/platform-fixture.ts - a child is taken for an owned process's when it names that pid and started after it, unless a live process holding that pid started before the child (then that one is its parent): this keeps the PowerShell running the check, which can be given a just-freed owned pid, and its console host out of the kill.
  • 조심해서 볼 파일: every Windows teardown goes through this (hided, Herdr, the desktop isolate); the walk is hashtable lookups over one CIM listing per pass, capped at 512 processes.
  • 판단해 주세요: the product's own OwnedChild::spawn has the same window (an owner killed between CreateProcess and AssignProcessToJobObject leaves a suspended child); in the product the owner is hided itself, killed only by a crash or a forced stop. Worth its own issue?

Evidence

  • 확인한 것: run 37391023049 shard 3/4: Herdr's session log says herdr exiting at 00:08:29.65, the test failed at 00:08:30.50 after endWindowsProcesses returned clean; the fixture's claude.exe runs as the two agents (Herdr's tree) and as hided's provider (hided's tree, and the root path check); hided's log for that attempt ends on provider_usage codex credentials_missing, the probe that runs just before claude's.
  • 확인한 것: the new desktop/e2e/windows-processes.unit.ts starts cmd.exe running ping, lists only cmd.exe, kills it, and requires endWindowsProcesses to end the ping it started; it runs in the Windows check lane (desktop test) and is skipped elsewhere. The old function ended only the listed processes and those run from a root, so ping would have run on (read from the code, not run).
  • 확인한 것: pnpm --dir desktop lint, pnpm --dir desktop typecheck and pnpm --dir web lint pass locally; the PowerShell runs only on Windows, in this run.
  • 확인하지 못한 것: that the survivor in Flaky test: Main, Overview and a Workspace with its columns, tools and delegated child #581 was a suspended child; the run did not list what held claude.exe. The change ends any process an owned one started, which covers it whatever its state.

A fixture lists hided's and Herdr's process tree while they run, kills them,
then ends the listed processes and anything run from its root. A child the
owner started after the listing was missed: hided starts a provider
suspended and puts it in its kill-on-close job before resuming it, so one
started as the daemon was killed stays suspended outside any job, keeps the
fixture's claude.exe locked, and the root could not be removed (EPERM).
endWindowsProcesses now also ends every process an owned one started, found
by parent pid and start time after the owner is gone, and stops what is left
on every pass.
@yansfil
yansfil merged commit 6fe2f8e into main Oct 6, 2026
18 checks passed
@yansfil
yansfil deleted the fix/flaky-581 branch October 6, 2026 03:51
yansfil added a commit that referenced this pull request Oct 8, 2026
Related: yansfil/sasu#30 (`/ship merge`가 이 검사를 매 머지마다 돌리고 출력을 보여 주게 하는
쪽)

## Summary

Hide와 GitHub은 PR과 이슈를 `Closes #N` 같은 closing keyword로만 잇는데, 10-06~07에
이슈를 끝낸 PR 7개(#607 #612 #614 #622 #631 #634 #712)가 이 줄 없이 머지됐고 이슈는 손으로 닫혀
연결이 남지 않았습니다.
이제 `scripts/premerge-check.py`가 닫는 이슈가 없는 PR에 머지 명령 바로 위에서 알림을 한 줄 찍습니다.
막지는 않습니다. 이슈 없이 시작한 PR(PRD 작업, CI·문서 변경)도 많기 때문입니다.

```
note: #454 closes no issue. If it finishes one, put `Closes #<issue>` on the body's Closes line before merging (editing the body does not rerun `verify`); with no issue, merge as it is.
#454 may merge now: gh pr merge 454 --merge --match-head-commit a1eda76...
```

## Review

- **판단해 주세요**: 알림만 하고 막지 않는 수준이 맞는지. 막으려면 "이슈 없음"을 PR 본문에 명시하는 규칙이 따로
필요합니다.

## Evidence

- **확인한 것**: 실제 PR로 실행. 이슈를 닫는 #781에는 알림 없음, 닫는 이슈가 없는 #454에는 위 알림이 찍히고
머지 가능 판정은 그대로.
- **확인한 것**: `test_premerge_check.py`에 알림 유무 테스트 1개 추가, `scripts/tests`
206개 통과, `check-no-attribution` 통과.
- **확인하지 못한 것**: PR을 만드는 순간의 알림은 없습니다. 머지 직전에만 알려서, 그때 본문을 고치는 흐름입니다.
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