Skip to content

fix: order what the device link tests race on - #2220

Merged
yansfil merged 3 commits into
mainfrom
fix/flaky-device-link
Nov 8, 2026
Merged

yansfil merged 3 commits into
mainfrom
fix/flaky-device-link

Conversation

@yansfil

@yansfil yansfil commented Nov 7, 2026 •

Copy link
Copy Markdown
Contributor

Closes with-hide/hide-private#210
Closes with-hide/hide-private#503
Closes with-hide/hide-private#149
Closes with-hide/hide-private#294
Related: with-hide/hide-private#718 #719 (제품 쪽 후속), #173 (hook 시간 초과는 원인 미확정, 진단만 추가), #457 (relay, 진단만 추가), #339 #398 (WSL, 이슈에 원인과 남은 일을 적음)

Summary

기기 연결 테스트가 가끔 실패하던 원인 넷을 고쳤습니다. 제품 코드는 바뀌지 않고 테스트 보조 코드와 CI 입구만 바뀝니다.

Review

  • 판단해 주세요: 반복 실행을 새 workflow가 아니라 remote-mailbox.yml의 workflow_dispatch + repeat 입력으로 둔 것. test_vt_cache.py가 vt-cache 사용 workflow 목록을 고정해서 새 파일은 정책 검사에 걸립니다.

  • 조심해서 볼 파일: hided/tests/it/support/sshd.rs - 준비 판정을 연결 성공에서 자기 로그의 "Server listening ... port N."으로 바꾼 곳(macOS sshd로 문구 확인). 재시작(online(false) 뒤 online(true))은 로그가 이어 쓰이므로 spawn 뒤에 쓰인 부분만 읽고, 같은 포트를 잃으면 이유를 말하며 실패합니다. system_ssh에 이 경로를 확인하는 시험을 더했습니다.

  • 조심해서 볼 파일: hided/tests/it/device_own_engine.rs - asker가 파일이 생길 때까지 기다리는 셸 반복. 상태를 기다리는 것이고 시간을 기다리지 않습니다.

  • 질문: #173의 11월 7일 실패는 hook이 제품 예산(INTAKE_BUDGET 1.65초) 안에 답을 못 받은 것입니다. 부하 때문에 예산을 못 지키는 경우를 테스트가 어떻게 다룰지(병렬도를 줄일지) 정하지 못해 이번엔 진단만 넣었습니다.

  • 후속 이슈: #149의 남은 틈(노드가 연결을 닫은 뒤에 자리를 돌려주는 것)은 제품 쪽이라 #718에, #503의 제품 쪽 경쟁(holder 기록이 Running이 되기 전의 첫 hide 호출 거절)은 #719에 적었습니다. 테스트 쪽 원인은 이 PR이 고쳤습니다.

  • 반복 실행은 --retries 0으로 돌아, 한 번의 실패가 job의 실패입니다.

Evidence

  • 확인한 것: cargo check와 clippy -D warnings(hided, hide-relay 테스트)가 통과합니다. 포트 충돌 메시지(Bind to port N on 127.0.0.1 failed: Address already in use)와 listening 문구는 이 Mac의 sshd에서 직접 확인했습니다.
  • 확인한 것: Open a checkout's pull request from its row glyph and describe it in a hover card #210 원인은 실패한 CI 실행(42085737360)의 보관된 sshd 로그에 Address already in use와 데몬의 host_key_changed가 함께 있는 것으로 확인했습니다.
  • 확인하지 못한 것: #503의 원인은 코드 읽기로 좁힌 것입니다(hide-holder/src/holder.rs의 spawn 뒤 running 기록 사이). 실패한 CI에는 asker 화면이 없었고, 이번 변경이 다음 실패 때 그 화면을 남깁니다.
  • 확인한 것: remote mailbox 레인(Linux)을 이 브랜치에서 repeat=10으로 돌려 10회 모두 통과했고(33개 x 10, 재시도 0번, FLAKY 줄 없음) https://github.com/with-hide/hide/actions/runs/42386421651 에서 볼 수 있습니다.
  • 확인한 것: 재시작 경로를 고친 head 6817f7c09에서 --retries 0으로 다시 repeat=10을 돌려 10회 모두 통과했습니다(33개 x 10, no flaky test) https://github.com/with-hide/hide/actions/runs/42429757957
  • 확인하지 못한 것: 고치기 전 실패율은 이슈별로 며칠에 한두 번이라 10회 통과가 재발 없음을 증명하지는 않습니다. 이 Mac에서는 레인을 돌리지 않았습니다.

A test's own sshd chose its port by binding port 0 and letting it go, and
reported itself ready when any listener answered on that port. Another test's
sshd took the port first, the test's sshd exited with "Address already in
use", and the daemon signed in to the other server and stopped at
host_key_changed (with-hide/hide-private#210). A server is now ready only when
its own log says it listens, and one that lost the bind is started again on
another port.

The device pane asker asked the node for a credential as soon as its program
started, before the holder wrote the pane's record as running, and was
refused once with no retry (#503). The test now releases the asker after the
node's proof of the pane, and a failed wait shows the asker's screen.

The node's caller cap probe wrote its request to a connection the node had
already answered and ended (#149), and the setup renderer's receipt wait gave
up after 64 frames of a busy daemon (#294); one now only listens, the other
waits by time.

The remote hook's miss and the relay's non-binary frame (#173, #457) now say
which stage ran out and which message arrived. The remote mailbox lane can be
repeated by hand on a branch (repeat input).
The test sshd's log is appended to across restarts, so a restart took the
first start's listening line for its own and returned before the server
bound the port. A start now reads only what its own server wrote, and a
restart that lost its port says so. A repetition run takes no retries, so
one failure fails the job.
@yansfil
yansfil added this pull request to the merge queue Nov 8, 2026
Merged via the queue into main with commit 5a1906c Nov 8, 2026
111 of 113 checks passed
@yansfil
yansfil deleted the fix/flaky-device-link branch November 8, 2026 05:15
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