Skip to content

통과한 remote fixture의 run 폴더를 한 곳에서 지움 - #934

Merged
yansfil merged 2 commits into
mainfrom
fix/remote-delivery-run-dir-899
Oct 10, 2026
Merged

yansfil merged 2 commits into
mainfrom
fix/remote-delivery-run-dir-899

Conversation

@yansfil

@yansfil yansfil commented Oct 10, 2026 •

Copy link
Copy Markdown
Contributor

Closes #899

Summary

  • remote_delivery의 세 journey 중 첫 번째만 통과 뒤 run 폴더를 지웠고, 나머지 둘은 프로세스만 정리해서 통과한 실행마다 계정과 staged 바이너리 약 400 MB가 agents/runs/에 남았습니다.
  • "통과하면 지우고 실패하면 남긴다"를 fixture 한 곳으로 모았습니다. fixture는 Fixture::journey(|fixture| { ... })로만 시작하고, 끝 처리(finish, hided/tests/it/support/run.rs)가 소유 프로세스를 먼저 멈춘 뒤 통과면 폴더를 지우고 실패면 남기며 첫 오류를 폴더 경로와 함께 돌려줍니다. 테스트는 더는 지우거나 남기는 코드를 쓰지 않습니다.
  • 같은 fixture 패턴을 쓰는 remote_core의 스무 개 journey가 각자 여섯 줄 match를 복사해 쓰고 있어 같은 구조로 바꿨습니다(이쪽은 이미 지우고 있었습니다). start는 비공개가 됐습니다.
  • 한 journey만 실패 경로에서 손으로 하던 SIGCONT(멈춘 node 재개)를 remote_core fixture의 stop으로 옮겼습니다. 다른 journey가 SIGSTOP 뒤에 실패해도 같은 방식으로 정리됩니다.
  • 로컬 확인 중 만난 별도 원인 하나를 따로 커밋해 고쳤습니다: 테스트 shim이 타이밍 파일을 만든 뒤에 써서, 그 사이에 읽으면 cannot parse integer from empty string으로 실패했습니다. 임시 파일에 쓰고 rename합니다.

Review

  • 조심해서 볼 파일: hided/tests/it/support/run.rs - 규칙 전체입니다. 통과했지만 프로세스가 종료를 확인하지 못했으면 폴더를 남기고 실패시킵니다(teardown은 단언). 실패한 journey 뒤의 teardown 실패는 journey의 오류를 가리지 않습니다.
  • 조심해서 볼 파일: hided/tests/it/support/remote_core.rs의 stop - 모든 node에 SIGCONT를 보낸 뒤 종료합니다. 멈추지 않은 프로세스에는 영향이 없습니다.
  • 조심해서 볼 파일: hided/tests/it/support/remote_delivery/mod.rs 끝의 C shim - 타이밍 파일을 .tmp로 쓰고 rename합니다. 별도 커밋(Write a fixture command's timing file whole)이라 따로 볼 수 있습니다.
  • 판단해 주세요: remote_core.rs의 스무 곳은 기계적 변환입니다(let mut fixture = Fixture::start()?; let journey = (|| { -> Fixture::journey(|fixture| {와 끝의 match 삭제, clippy가 요구한 &fixture -> fixture 24곳). 본문은 들여쓰기도 그대로입니다. diff가 크게 보이는 이유입니다.
  • 경계 밖: 운영 코드는 건드리지 않았고 테스트 fixture만 바꿨습니다.

Evidence

  • 확인한 것: support::run::tests의 4건이 통과합니다(통과하면 폴더가 없다, 실패하면 폴더와 자기 오류를 남긴다, 실패한 journey 뒤 teardown 실패가 journey 오류를 가리지 않는다, 통과했어도 종료 미확인이면 폴더를 남긴다). 이 4건은 기본 lane(rust workspace)에서 돌고 ignore가 아닙니다.
  • 확인한 것: 고친 remote_delivery::ending_the_recipients_registration_ends_the_senders_answer_wait_and_says_why를 격리 Herdr 0.9.3로 한 번 돌려 통과했고 agents/runs/에 rd-* 폴더가 남지 않았습니다(45 s). 바꾸기 전 코드에서는 이 journey의 끝에 remove_run_dir 호출이 없는 것을 코드로 확인했고, 실행으로 재현하지는 않았습니다(run 하나가 약 400 MB).
  • 확인한 것: 같은 실행의 첫 시도가 타이밍 파일 경합으로 실패했을 때 폴더가 run kept at <path>와 함께 남았습니다(실패하면 남긴다는 쪽의 실제 관찰). 원인은 위의 shim이고, 고친 뒤 재실행이 통과했습니다.
  • 확인한 것: remote_core::a_node_of_another_build_or_the_cores_own_machine_is_refused를 한 번 돌려 통과했고 rc-* 폴더가 남지 않았습니다(6 s).
  • 확인한 것: verify-cargo.sh lint(fmt와 clippy -D warnings), check-no-attribution.py, check-no-workstation-identity.sh, check-harness-ignore-anchor.sh.
  • 확인한 것: scripts/check-runtime-gates.sh(verify-cargo.sh test 전체, verify-web.sh 전체, Herdr pin과 schema 비교)가 이 브랜치에서 종료 코드 0으로 끝났습니다.
  • 확인한 것: CI remote mailbox (ubuntu-latest)가 remote_delivery 세 개와 remote_core 스무 개를 모두 돌려 통과했습니다(3m15s). 로컬에서는 각 한두 개만 돌렸습니다.
  • 확인하지 못한 것: CI runner에서 통과 뒤 폴더가 남지 않았는지는 보지 못했습니다(runner는 버려집니다). 폴더 정리는 로컬 실행과 finish 단위 테스트가 근거입니다.
  • 확인하지 못한 것: macOS 쪽 lane(remote mailbox (macOS), nightly)은 돌리지 않았습니다.

Two of the three remote delivery journeys ended with only the process
cleanup, so a passing run left its accounts and staged binaries, about
400 MB each, under agents/runs/. The twenty remote core journeys
repeated a six line match to avoid the same omission.

A fixture is now started only through Fixture::journey, which takes the
journey as a closure and ends the run by how it went: the owned
processes stop first, a pass removes the directory, a failure keeps it
and returns the first error with the path. The rule lives in
support/run.rs and is held by its own tests. The remote core fixture
also resumes a node a journey stopped before it ends it, which only one
journey's failure path did by hand.
The pane shim created the timing file before it wrote it, and the test
takes the file's existence as the command's end, so a read in between
saw an empty file and failed with "cannot parse integer from empty
string". The shim now writes a temporary file and renames it.
@yansfil
yansfil merged commit dc6cb76 into main Oct 10, 2026
20 checks passed
@yansfil
yansfil deleted the fix/remote-delivery-run-dir-899 branch October 10, 2026 06:35
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.

remote_delivery 두 journey가 통과한 실행의 fixture 폴더를 지우지 않아 lane마다 수백 MB가 남는다

1 participant