Skip to content

fix: remove the causes of the OpenCode usage and late-session spawn flakes - #1819

Merged
yansfil merged 2 commits into
mainfrom
fix/flaky-rust-misc-nightly
Oct 29, 2026
Merged

yansfil merged 2 commits into
mainfrom
fix/flaky-rust-misc-nightly

Conversation

@yansfil

@yansfil yansfil commented Oct 29, 2026

Copy link
Copy Markdown
Contributor

Closes with-hide/hide-private#304
Closes with-hide/hide-private#305

Summary

부하에서 가끔 깨지던 Rust 테스트 두 건의 원인을 고칩니다. 같은 묶음의 나머지 세 건은 이슈별로 아래에 적었습니다.

스크린샷 없음: 화면을 바꾸지 않는 테스트와 읽기 경로 변경입니다.

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로 다시 관찰합니다. 그래서 운영에서 미룬 관찰을 잃지 않고, 관찰을 한 번만 하는 쪽은 테스트였습니다.
  • 판단해 주세요: Fix the evening e2e flakes at their causes and quarantine the split-output stall #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분을 넘겨 실패합니다(Recover Herdr connections without replaying read work #115, 위). 이 PR은 그 lane을 고치지 않았습니다.
  • 확인하지 못한 것: #304의 "첫 행은 항상 읽는다"는 시계를 주입할 수 없어 결정적인 테스트가 없습니다. 부하에서만 새 단언(더 남은 읽기는 1행 이상)이 그 결함을 잡습니다.
Verification record

A read whose opening outlasted the 10 ms budget returned with no row, so a
loaded machine could keep a read from moving on. The budget is now checked
from the second row, as the line readers do. The test of the scan total
asserts that no read takes more than two 3 MiB rows and that every read with
more to come took one, instead of the exact count the time budget can cut.

Closes with-hide/hide-private#304
…s batch

The test observes the lineage writer once after the session shows, where the
session sync observes it every second. The writer plans an observation made
while its previous batch is still queued at the next observation, so on a
loaded machine the bind was never planned. The test now waits for the
writer's worker to take the at-rest batch first.

Closes with-hide/hide-private#305
@yansfil
yansfil merged commit e5857ef into main Oct 29, 2026
31 checks passed
@yansfil
yansfil deleted the fix/flaky-rust-misc-nightly branch October 29, 2026 03:13
yansfil added a commit that referenced this pull request Oct 29, 2026
… growing (#1820)

Closes with-hide/hide-private#115
Related: #1819

## Summary

nightly의 performance (macOS) topology lane이 'Build the web shell' 5분 제한에
걸려 실패합니다(main 047d0944d에서도 재현, run 40803125317). 그 단계의 4m26s가 웹
타입검사(`tsc --noEmit`)였고 `vite build`는 15초였습니다.

원인: 번역 문구 타입이 영어 문장 전체(리터럴)여서, i18next가 번역 함수 타입을 만날 때마다 메시지 약 3,800개의
문장을 다시 파싱했습니다. 그래서 타입검사 시간이 catalog와 함께 자랐습니다(10-24엔 단계 전체 3분).

수정: 각 메시지를 문장이 아니라 그 `{{이름}}` placeholder만으로 타입을
매깁니다(`web/src/i18n/i18next.d.ts`). 호출부 검사는 그대로 남습니다. 로컬 타입검사 87초 -> 14초.

스크린샷 없음: 타입 선언만 바뀌고 화면에 그리는 것은 같습니다.

## Review

- **판단해 주세요**: conductor가 고른 안 C(placeholder만 담은 타입)를 생성 스크립트 없이
TypeScript 타입 하나로 만들었습니다. catalog에서 한 번 계산되는 mapped type이라 생성 파일과 최신 여부
검사가 필요 없고, 같은 속도가 나옵니다. 생성 스크립트 방식이 꼭 필요한지 판단해 주세요.
- **판단해 주세요**: 시간 제한(5분)은 그대로 두었습니다.
- **조심해서 볼 파일**: `web/src/i18n/i18next.d.ts` - 모든 `t()` 호출의 타입. `t()`의
반환 타입이 영어 문장 리터럴에서 placeholder 모양의 문자열로 바뀝니다. 그 리터럴에 기대던 코드는 없었습니다(타입검사
통과).

## Evidence

- **확인한 것**: 같은 호출 묶음을 두 타입으로 검사해 오류가 같음을 확인. 둘 다 오류: placeholder 누락,
`null` 값, 객체 값, 없는 키. 둘 다 통과: 맞는 호출, 숫자 값, 추가 변수, plural `count`,
`defaultValue`, options 생략(i18next 규칙).
- **확인한 것**: `instance.test.ts`의 `@ts-expect-error` 세 줄(틀린 이름, `null`,
객체)이 여전히 오류를 잡습니다(쓰이지 않으면 tsc가 실패).
- **확인한 것**: `tsc --noEmit --extendedDiagnostics` 같은 기계에서 87.1초 ->
12.8초(Check time). 원인 추적: trace에서 105초 중 92.6초가 `t()` 호출 11곳, 리터럴 키 한 번만
쓰는 파일도 14초.
- **확인한 것**: `scripts/verify-web.sh web typecheck|lint|test|build`
통과(테스트 2243개), `desktop typecheck` 통과.
- **확인한 것**: 이 브랜치의 `perf.yml` dispatch(run 40805862521)가 통과, 'Build the
web shell' 47초(main은 5분 초과로 실패, run 40803125317).
- **확인하지 못한 것**: 다음 예약 nightly는 아직입니다. 이슈는 그 nightly가 이 lane을 통과시킬 때
닫힙니다.

<details><summary>Verification record</summary>

- base 047d094, head f3a153b

</details>
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