Repository navigation
Cut the web end-to-end setup cost: one hided build, one zsh download, six Linux shards - #305
Merged
Merged
Conversation
yansfil
force-pushed
the
ci/e2e-shard-setup
branch
3 times, most recently
from
October 1, 2026 17:39
26ed9e9 to
8840f68
Compare
…shards Every shard rebuilt hided with cargo and installed zsh and Chromium's system libraries from the Ubuntu mirror, which serves about 60 kB/s when many runners ask at once, so shards lost 3 to 9 minutes to setup and one stalled until the job timeout. With more than one shard the lane builds hided once and hands target/debug to the shards as an artifact; on Linux a separate job fetches the zsh packages once and the shards install them with dpkg. Chromium installs without --with-deps, since the runner image already carries its libraries. Every setup step has a timeout, so a stall fails under its own name.
Six shards cost about 31 job-minutes against about 56 for eight and keep the lane near the wall time it had; the measurements are in the comment above the setting.
yansfil
force-pushed
the
ci/e2e-shard-setup
branch
from
October 1, 2026 17:39
8840f68 to
f866d9e
Compare
yansfil
marked this pull request as ready for review
October 1, 2026 17:40
This was referenced Oct 1, 2026
yansfil
added a commit
that referenced
this pull request
Oct 29, 2026
…lakes (#1819) Closes with-hide/hide-private#304 Closes with-hide/hide-private#305 ## Summary 부하에서 가끔 깨지던 Rust 테스트 두 건의 원인을 고칩니다. 같은 묶음의 나머지 세 건은 이슈별로 아래에 적었습니다. - **#304 OpenCode 사용량 읽기**: 읽기가 10 ms 시간 예산을 첫 행을 읽기 전에도 검사해서, DB를 여는 데 그 시간을 넘기면 행을 하나도 읽지 않고 끝났습니다. 이제 예산은 둘째 행부터 검사합니다(줄 파일 읽기와 같은 규칙). 그래서 읽기는 언제나 전진합니다. 테스트는 시간 예산이 자를 수 있는 정확한 개수(첫 읽기 2행) 대신, 읽기마다 scan total 이하(3 MiB 행 2개), 더 남은 읽기는 1행 이상, 전체 4행을 단언합니다. - **#305 늦게 세션을 보이는 자식의 bind**: 테스트가 session sync 대신 lineage writer를 관찰시키는데, 세션이 보인 뒤 한 번만 관찰시킵니다. writer는 이전 batch가 아직 worker에게 넘어가지 않았으면 그 관찰을 다음 관찰에서 처리하므로, 부하에서 worker가 늦으면 bind가 계획되지 않았습니다. 테스트가 이제 at-rest batch를 worker가 가져간 뒤에 세션을 보이게 합니다. - **#174** links_store_busy: main의 1a90d50(#1567)가 이미 고쳤고 그 뒤 재발이 없어 근거와 함께 닫았습니다. - **#134** agy signed in: 그 lane은 ff9b090(운영자 결정 10-27)로 CI에서 빠졌고, 남은 agy contract는 세 OS 모두 통과해 닫았습니다. - **#115** perf topology 'Build the web shell': main에서도 다시 실패합니다(원인: 웹 타입검사 시간이 catalog와 함께 커짐). 고치는 방식을 conductor에게 묻는 중이라 이 PR에는 아직 없습니다. 스크린샷 없음: 화면을 바꾸지 않는 테스트와 읽기 경로 변경입니다. ## Review - **판단해 주세요**: #305를 제품이 아니라 테스트에서 고친 판단. 운영에서는 subscription이 살아 있는 동안 session sync가 1초마다 `agent.list`를 묻고 답마다 `writer.observe`를 부릅니다(`session_sync/coordinator.rs` 318-322행, 825-836행). 미뤄진 관찰은 `pending_retry`로 남아 다음 관찰이 바뀐 것 없이도 계획하고(`a_full_pending_batch_is_retried_without_duplicating_in_flight_patches`), 재연결은 `changed=true`로 다시 관찰합니다. 그래서 운영에서 미룬 관찰을 잃지 않고, 관찰을 한 번만 하는 쪽은 테스트였습니다. - **판단해 주세요**: #304 테스트의 기대값 변경. 요구(scan total을 넘는 행은 다음 읽기가 읽는다)는 그대로이고, 시간 예산이 자를 수 있는 정확한 개수를 단언하던 테스트가 요구를 잘못 표현했던 것입니다. 시간 예산(10 ms)은 바꾸지 않았습니다. - **조심해서 볼 파일**: `hide-session/src/usage/opencode.rs` - 사용량 읽기 경로(high-frequency path). 행마다 하는 일은 그대로이고, 첫 행에서 시간 검사 하나를 건너뜁니다. - **조심해서 볼 파일**: `herdr-core/src/coordination/lineage.rs` - 테스트 전용(`#[cfg(test)]`) 조회 하나만 더했습니다. ## Evidence - **확인한 것**: #305는 worker가 batch를 가져가기 전에 300 ms 지연을 심어 이슈와 같은 실패(`timed out waiting for the core binds the late child`)를 재현했고, 수정한 테스트는 같은 지연에서 통과했습니다. 지연은 되돌렸습니다. - **확인한 것**: #304는 scan total을 끄는 결함을 심으면 새 테스트가 `read 1 took 4 rows`로 실패하는 것을 확인하고 되돌렸습니다. - **확인한 것**: `scripts/verify-cargo.sh nextest -p hide-session -p herdr-core` 3796개 통과, `scripts/verify-cargo.sh lint`(fmt, clippy 전체) 통과. 로컬 load average 15-80, 디스크 98%. - **확인한 것**: `nightly.yml` lane=agy를 main 047d0944d에서 dispatch, agy contract와 agent trust contract 6개 job 모두 통과(run 40803128207). - **확인하지 못한 것**: `perf.yml` dispatch(run 40803125317)는 main에서 'Build the web shell'이 5분을 넘겨 실패합니다(#115, 위). 이 PR은 그 lane을 고치지 않았습니다. - **확인하지 못한 것**: #304의 "첫 행은 항상 읽는다"는 시계를 주입할 수 없어 결정적인 테스트가 없습니다. 부하에서만 새 단언(더 남은 읽기는 1행 이상)이 그 결함을 잡습니다. <details><summary>Verification record</summary> - base 047d094, head 7feb3b2 </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.
Related: #294 (Linux web e2e lane), #302 (windows check, same
pr.yml)Summary
#294 이후 verify 한 번이 약 14개 job이고, 조직 한도가 동시 20 job이라 run 두 개만 겹쳐도 Linux shard가 대기열에 쌓였습니다.
shard 8개가 매번 같은 준비를 반복하고 있었습니다: cargo로
hided빌드 1.52.4분,1.6분, Chromium 시스템 라이브러리 apt 설치 최대 5.5분.zsh설치 1.1이 PR은
hided를 lane당 한 번만 빌드해 shard에 넘기고,zsh도 한 번만 받아 넘기고, apt가 필요 없는 Chromium 설치로 바꿔 shard를 6개로 줄입니다.테스트 내용,
@flaky격리 step, 실패 artifact,verify하나가 필수 검사라는 점은 그대로입니다.97 s + cargo 92145 s + Chromium 17~335 s@platformjobrun 전체 숫자에는 이 PR과 무관한 차이가 섞여 있습니다: 뒤 run에는 #302의 windows check 2.4분이 있고, desktop e2e는 9.2분(실패)에서 6.1분으로 달랐습니다.
lane 안의 비교(56.5에서 31.4, 25.1 job-분 절감)가 깨끗한 값입니다.
같은 구조의 다음 run(36898497112, 주석만 바뀐 head)도 Linux lane이 31.9 job-분, wall 9.4분, shard 6개 모두 통과였습니다.
앞 run의 Linux 나머지 7개 shard는 5.2~8.1분이었고, lane wall 11.4분은 apt에 막힌 shard 하나가 정했습니다.
Review
--with-deps없이 설치합니다. runner 이미지가 이미 가진 라이브러리로 Chromium이 뜨고 suite가 통과했지만,--with-deps가 깔던 글꼴(CJKfonts-wqy-zenhei,fonts-freefont-ttf,fonts-unifont,fonts-ipafont-gothic)은 이제 이미지 글꼴로 대체됩니다. Linux CI의 글자 모양만 달라질 수 있고, 텍스트 폭에 걸린 단언은 모두 통과했습니다.pr.yml의 설정 위 주석에 있습니다..github/workflows/web-e2e.yml- shard의if가build/zsh의skipped를 통과시키되 실패와 취소는 막아야 합니다. 단일 shard lane(macOS)은 제자리 빌드를 유지하고 build/zsh job은 건너뜁니다..github/workflows/pr.yml- 줄 수를 최소로 했습니다(shards: 6, 주석, 머리말의 "eight"). #302와 겹치지 않도록 그 외는 건드리지 않았습니다.Evidence
@platform, desktop e2e, rust, checks, windows check,verify.Install zsh and Chromium's system libraries에서 10분 만에 그 이름으로 실패했습니다.azure.archive.ubuntu.com이 56.6 kB/s로 응답해 zsh 4985 kB가 88초, Chromium 라이브러리 32 MB가 3분(최대 5.5분)이 걸렸고, 한 번은 10분을 넘겼습니다.man-db트리거는 원인이 아니었습니다(auto-update가 이미 꺼져 있음). 이미지에는 Chromium이 요구하는 패키지 중 10개(글꼴,libwayland-server0,xfonts-*)가 없고 4개(Mesa,libgbm1)는 더 낮은 버전이지만, 그것 없이도 Chromium이 실행됩니다:install-deps없이 run 36896943318이 통과했고 Playwright의 "missing dependencies" 메시지는 로그에 없습니다..debcache는 첫 miss가 같은 느린 mirror를 타서 문제를 못 풀었기에 쓰지 않고, 최종 구조(zshjob이 run당 한 번 받아 artifact로 전달)에는 cache가 없습니다.projects-sidebar.spec.ts:97,sidebar-menus.spec.ts:79). 둘 다 자기 Herdr와 hided를 띄우는 spec이라 shard 구성과 무관해 보이고, 이 PR 이전 main에도agent-tab-groups.spec.ts:236이 한 번 졌습니다. 최종 head의 run에서는 재현되지 않았지만 flake 자체는 이 PR이 고치지 않습니다.