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

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