Skip to content

owner handshake 테스트가 먼저 끝난 guard의 닫힌 입력을 실패로 읽지 않는다 - #835

Merged
yansfil merged 1 commit into
mainfrom
fix/flaky-827
Oct 8, 2026
Merged

yansfil merged 1 commit into
mainfrom
fix/flaky-827

Conversation

@yansfil

@yansfil yansfil commented Oct 8, 2026

Copy link
Copy Markdown
Contributor

Closes #827

Summary

owner handshake가 거절되면 hook은 payload를 읽기 전에 곧바로 성공으로 끝납니다(hide-agent-hooks/src/bin/hide-agent-hooks.rs의 OwnerWatch::from_launch 분기).
그래서 이 테스트가 stdin에 payload를 쓰는 동안 guard가 먼저 끝나면 닫힌 pipe를 만나 BrokenPipe로 실패했습니다(Linux CI).
이제 이 테스트도 다른 guard 실행이 쓰는 send_payload로 쓰고, 그 helper는 닫힌 pipe를 agent가 보는 그대로(결과는 guard의 답)읽습니다.
guard의 종료 코드와 출력에 대한 assertion은 그대로입니다.

Evidence

  • 확인한 것: 테스트가 guard의 종료를 기다린 뒤 쓰게 바꾸면 CI와 같은 Os { code: 32, kind: BrokenPipe }로 매번 실패했습니다(수정 전 코드).
  • 확인한 것: 수정 뒤 verify-cargo.sh test-scoped -p hide-agent-hooks 2번 통과(it 72개), verify-cargo.sh lint 통과.
  • 확인하지 못한 것: 원래 경합은 이 Mac에서 60번 반복해도 0번 나왔고, Linux에서는 CI에 맡깁니다.

A refused owner handshake ends the hook at once, before it reads its
payload, so the test's write to its input met a closed pipe whenever the
guard won that race, which Linux CI saw as BrokenPipe (issue 827). Waiting
for the guard to exit before writing made it fail every time.

The test now writes through the same `send_payload` the other guard runs
use, which reads a closed pipe as what an agent sees there; the assertions
on the guard's exit status and output are unchanged.
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.

Flaky test: hide-agent-hooks::it spawn_guard::a_failed_owner_handshake_never_ends_the_guard_with_a_refusal_code

1 participant