Repository navigation
fix: start the core-move fixture's device already holding its build - #1751
Merged
Merged
Conversation
…dr copy by its held bytes The core-move fixture's target now starts holding the fixture's build in its helper root, as a device that connected before does: sending the 140 MB debug hided and hide (written and read back) took 18 to 29 s of the 30 s readiness bound on the Linux runner. The Herdr copy test held an inode comparison the system may answer either way; it now holds the old file open and reads its old bytes after the update.
Pull request 1750 holds the old file open in the same test; one change to it keeps the two from conflicting.
yansfil
added a commit
that referenced
this pull request
Oct 29, 2026
…wner flakes (#1813) Closes with-hide/hide-private#119 Closes with-hide/hide-private#281 Closes with-hide/hide-private#118 Closes with-hide/hide-private#120 Closes with-hide/hide-private#201 Closes with-hide/hide-private#313 Related: with-hide/hide-private#189, with-hide/hide-private#288 (원인 미확정, 이 PR에서 닫지 않음) ## Summary hided 통합 테스트의 core_move·remote_core·node_owner flaky와 macOS remote mailbox nightly 실패를 원인에서 고칩니다. 제품 코드 변경은 하나: 두 writer가 같은 진단 로그에 쓸 때 기록이 서로 섞이던 것을, 기록 하나를 한 번에 쓰도록 고쳤습니다. 나머지는 테스트 쪽입니다: 상태 대신 짧은 시간이나 한 번의 읽기에 기대던 대기, 실패한 run이 남긴 바이너리로 찬 디스크, macOS에서 runner의 `gh`가 fixture의 것보다 먼저 잡히던 PATH. #189/#288은 재현되지 않아 범위에서 뺐고, lane이 이제 실패와 flaky run의 `rc-*` 로그를 남깁니다. 스크린샷 없음: 화면을 건드리지 않습니다. <details><summary>이슈별 원인과 처리</summary> - **#119** node_owner refusal: `writeln!`이 줄과 개행을 두 번 write해, `record_now`와 writer 스레드 사이에 다른 기록이 끼었습니다(CI 로그에 refusal 줄 뒤로 `start.step`이 붙어 있음). 줄과 개행을 한 `write_all`로 씀. - **#118** a_newer_app...: 기기 helper upload(디버그 `hided`·`hide` 각 140MB)가 30초 bound를 넘던 것. #1751이 이미 고쳤고, 이후 CI는 `upload sent 0, reused 3`, 약 9초에 ready. 이슈에 근거 코멘트. - **#281** manifest refusal: #1751 이후 남은 두 실패. (a) move back이 rolled_back을 기록한 뒤 node role이 시작되는데(#962) 이 테스트만 role을 한 번 읽음 -> 모든 move back rollback이 쓰는 `back_rolled_back` helper. (b) `os error 11`: fixture renderer가 handshake와 첫 snapshot을 2초 socket read로 묶어, 호출자의 30초 wait를 즉시 실패시킴 -> read는 hang guard만, 실패 시 무엇을 기다렸는지 말함. - **#120** linked state folder: 같은 job에서 `/tmp`가 `Disk quota exceeded`가 된 직후의 timeout. 앞선 실패 run마다 바이너리 약 0.9GB가 남은 탓 -> 남기는 run은 native program을 지우고 로그만 남김. fixture가 만들어지기 전 setup이 실패한 run도 같음. - **#313** a_failing_move_back_check...(이 PR의 첫 CI에서 발견): supervisor가 journal `done`을 move view가 `linking`을 벗어나기 전에 써서, 그 사이 요청이 `move_busy`로 거절됨 -> `forward_done`이 창의 move view `done`까지 기다림. - **#201** macOS nightly(10-17 이후 매번 실패): core가 `not_logged_in`으로 답함. macOS login shell의 `path_helper`가 시스템 폴더를 앞에 두어 runner의 `gh`가 먼저 잡힘 -> fixture HOME의 `.zprofile` 등이 계정 PATH를 앞에 둠(web fixture의 `fixtureLoginShellPath`와 같은 방식). - **node_owner `hide connect`**: 5초 wall-clock 단언은 부하에서 daemon 시작 시간을 쟀습니다(load 30에서 11.7초). 지우고, 종료가 다음 look에서 wait를 끝낸다는 것은 `wait_healthy_within`에 종료 신호를 주는 fake-clock 테스트로 증명. 통합 테스트는 파일과 이유만 봄. - **#189/#288** remote_core 화면(같은 테스트): Linux remote_core 23개 x 8회(184회), 로컬 macOS 69회, nightly macOS 23/23에서 재현 없음. lane이 `rc-*`를 올리지 않아 증거가 메시지뿐이었음. 결과와 다음에 볼 곳은 두 이슈에 코멘트. </details> ## Review - **판단해 주세요**: renderer의 2초 read를 30초 hang guard로 바꾼 것은 대기 늘리기가 아니라, 첫 snapshot이라는 신호를 오는 즉시 읽고 시간 추측으로 실패하지 않게 한 것입니다(TESTING.md, Writing a Rust test 5). - **조심해서 볼 파일**: `herdr-core/src/diagnostics.rs` - failure path(시작 거부 기록)의 쓰기 방식. - **조심해서 볼 파일**: `hided/tests/it/support/run.rs` - 남기는 run에서 ELF/Mach-O만 지우고 link는 따라가지 않음. - **조심해서 볼 파일**: `.github/workflows/remote-mailbox.yml` - flaky run도 로그를 올림, `rc-*`는 `*.log`와 `Logs/*.jsonl`만(fixture 경로는 담김), artifact 이름에 attempt. - **비용 검토**: 진단 기록 한 건마다 줄을 재사용 버퍼에 한 번 복사합니다(`writeln!`의 두 write 대신 한 `write_all`). 버퍼는 writer가 본 가장 긴 기록 크기에서 멈추고, 그 뒤 할당은 없습니다. ## Evidence - **확인한 것**: 새 diagnostics 테스트가 예전 `writeln!`에서 3/3 실패(CI와 같은 `{...}{...}` 섞임), 고친 코드에서 통과. - **확인한 것**: fake-clock 테스트에서 350ms에 종료한 daemon의 wait가 그 뒤 pause 없이 다음 look(425ms)에서 `exited with`로 끝남. - **확인한 것**: 바뀐 core_move 7개 x 3회(21회) 로컬 macOS 실패 0, 남은 `/tmp/hcm-*` 없음. diagnostics·node_owner·run 20회 반복 실패 0(load 26~30). - **확인한 것**: nightly `lane=macos` dispatch(run 40725749658)의 remote mailbox macos-15 첫 시도 통과: remote_core 23/23(#201 테스트 포함), core_move 44/44, flaky 0. - **확인한 것**: PR CI Linux remote mailbox: core_move 44/44, remote_core 23/23, flaky 0. - **확인하지 못한 것**: #189/#288 원인(Linux CI에서만 약 8% run에서 실패, stress 184회 재현 없음). - **확인하지 못한 것**: #201 수정 전 실패의 로컬 재현(이 Mac의 `/etc/paths` 폴더에 `gh`가 없음). 같은 nightly run의 web e2e macOS 실패는 이 diff와 무관. - **확인하지 못한 것**: windows check의 web 단위 테스트 `web/src/practice/worlds.test.ts` 5초 timeout(이 diff와 무관)은 실패 job만 한 번 재실행해 통과. <details><summary>Verification record</summary> - Head: `def885735` (review fix on top of `c9290db54`) - Base: `origin/main` (merge-order: Stay as you are) - Local, macOS arm64: `cargo nextest -p herdr-core -p hided` diagnostics·wait·node_owner 테스트 72/72 pass, 새 테스트 둘과 node_owner 20회 반복 실패 0, exit 확인을 deadline 뒤로 옮기면 새 cli 테스트 실패; clippy `-D warnings` 0 warnings, `cargo fmt --check` clean. - Local, macOS arm64: core_move 7개(manifest, newer app, linked state, failing move back, move back window, issues through move, staging failure) x 3 = 21/21 pass at c9290db. - CI: verify run 40729811159 at c9290db 39/39 pass (windows check 1회 재실행); nightly `lane=macos` run 40725749658 remote mailbox macos-15 pass. - Temporary stress (51af1e7, reverted in c9290db): remote mailbox ubuntu job 122933565889, remote_core 23 x 8 = 184 pass. - Review fix (this head): node_owner fake-clock exit test, reused log buffer, `rc-*` log allowlist. - Changed paths: `herdr-core/src/diagnostics.rs`, `hided/src/cli.rs`, `hided/tests/it/{node_owner,core_move}.rs`, `hided/tests/it/support/{core_move,run}.rs`, `hided/tests/it/support/remote_delivery/{mod,renderer}.rs`, `.github/workflows/remote-mailbox.yml`. </details>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #1059
Closes #1060
Closes #1062
Closes #1170
Closes #1241
Closes #1319
Closes #1373
Closes #1374
Closes #1375
Closes #1428
Closes #1429
Closes #1431
Closes #1554
Closes #1555
Closes #1607
Closes #1662
Closes #1663
Closes #1691
Closes #1706
Closes #1708
Closes #1712
Closes #1715
Closes #1727
Closes #1728
Closes #1743
Related: #1750 (the
herdr_handoffinode test, the other half of this task, is fixed there)Summary
core_move 테스트 여러 개가 "the target's helper ready" 대기 30초를 넘겨 같이 실패하며 관련 없는 PR의 CI를 빨갛게 만들었습니다.
원인은 테스트 준비 단계입니다: 픽스처마다 디버그 빌드
hided와hide(각 약 140 MB)를 대상 기기에 SSH로 보내고 다시 읽어 확인하느라 18-29초가 걸렸습니다. 연결의 나머지 단계는 합쳐 약 1초입니다.이제 픽스처의 대상 기기는 처음부터 이 빌드를 갖고 시작합니다(이전에 연결된 적 있는 기기처럼, 제품의
HelperPackages::install_here로 놓음). 연결은 여전히 helper의 바이트를 확인한 뒤에 시작하고, 다른 빌드를 쓰는 테스트는 그 빌드를 그대로 보냅니다.대기 한도(30초)는 그대로입니다. 늘리지 않고 느린 부분을 없앴습니다.
스크린샷 없음: 테스트 픽스처와 문서만 바뀌고 화면 변경이 없습니다.
Review
remote_delivery와device_bootstrap이 증명한다고 봤습니다. 괜찮은지.hided/tests/it/support/core_move.rs- helper root에 빌드를 미리 놓는 곳. 버전 폴더 이름과 권한은 제품 함수가 정하므로 원격 설치가 그대로 재사용합니다.Evidence
hide-core-move-logs아티팩트, 픽스처 30개의host.establish_stage와host.upload_stage기록.install_payload→start18.4-29.1초. 파일당 쓰기 약 6.5초 + 다시 읽기 약 8초,hided다음hide순서. connect/platform/start/hello/ready 합계 약 1초.host.upload_stage없음),install_payload→start1.4-1.7초(helper 다시 읽기만).core_move 테스트 시간 중앙값 15.3 / 16.0 / 15.8 / 21.8초, 최소 8.4-12.6초, core_move 단계 242-322초.
비교: main run 40510881153(eastus)은 재시도 4, 중앙값 38.3초, 최소 28.1초, 단계 559초.
herdr_handoff::tests::a_copy_hide_runs_replaces_the_file_with_a_new_one의 inode 비교 실패(이 PR과 무관, test: hold the old herdr open so its inode cannot pass to the new copy #1750 대기 중인 알려진 flaky). 시도 2에서 625개 모두 통과.로컬 전체 core_move 44개 동시 실행은 기계 부하(load 약 20)에서 픽스처 준비 명령 deadline과 디스크 부족으로 준비 단계에서 끝나 판단 근거가 되지 못했습니다.
Verification record