Skip to content

fix(ci): cargo-tarpaulin 설치에 --force 추가 (캐시 경합 해소) - #250

Merged
myyrakle merged 1 commit into
myyrakle:masterfrom
DPS0340:fix/tarpaulin-cache-race
Jul 26, 2026
Merged

fix(ci): cargo-tarpaulin 설치에 --force 추가 (캐시 경합 해소)#250
myyrakle merged 1 commit into
myyrakle:masterfrom
DPS0340:fix/tarpaulin-cache-race

Conversation

@DPS0340

@DPS0340 DPS0340 commented Jul 26, 2026

Copy link
Copy Markdown
Contributor

resolves: #249

coverage.ymlRust project 잡이 간헐적으로 실패하는 문제입니다. 지금도 제 #247에서 재현되고 있습니다.

Run cargo install cargo-tarpaulin --locked
error: binary `cargo-tarpaulin` already exists in destination
Process completed with exit code 101

원인

캐시 스텝 두 개가 같은 경로를 두고 겹칩니다.

- name: Cache Cargo's directories
  restore-keys: ${{ runner.os }}-cargo-      # 느슨하게 매칭
  path: ~/.cargo/bin/                        # ← cargo-tarpaulin 포함

- name: Cache cargo-tarpaulin
  key: ${{ runner.os }}-tarpaulin-v0.30      # 정확히 일치해야 함
  path: ~/.cargo/bin/cargo-tarpaulin

첫 캐시가 restore-keys 덕분에 ~/.cargo/bin/ 전체를 복원하면서 cargo-tarpaulin도 함께 가져옵니다. 두 번째 캐시는 키가 정확히 맞아야 하므로 Linux-tarpaulin-v0.30이 축출되면 미스가 나고, cache-hit != 'true' 조건이 성립해 설치를 시도합니다. 바이너리는 이미 있으니 죽습니다.

실패한 실행의 로그가 그 순서 그대로입니다:

Cache Cargo's directories  Cache restored from key: Linux-cargo-
Cache cargo-tarpaulin      Cache not found for input keys: Linux-tarpaulin-v0.30
Install cargo-tarpaulin    error: binary `cargo-tarpaulin` already exists

tarpaulin 캐시가 살아 있으면 통과하고 없으면 실패하므로, PR마다 결과가 갈립니다. 실제로 지금 #241/#242/#246은 SUCCESS인데 #247만 FAILURE입니다.

수정

-run: cargo install cargo-tarpaulin --locked
+run: cargo install cargo-tarpaulin --locked --force

이미 있으면 덮어쓰므로 두 캐시가 어떻게 엇갈리든 안전합니다.

검증

로컬에 이미 설치된 크레이트로 두 경로를 모두 확인했습니다:

$ cargo install cargo-audit --locked
     Ignored package `cargo-audit v0.22.2` is already installed, use --force to override

$ cargo install cargo-audit --locked --force
   Replacing /Users/lee/.cargo/bin/cargo-audit
    Replaced package `cargo-audit v0.22.2` (executable `cargo-audit`)

cargo 자신이 --force를 안내하고, 실제로 성공합니다.

대안

Cache cargo-tarpaulin 스텝을 아예 없애는 방법도 있습니다 — 첫 캐시가 이미 ~/.cargo/bin/을 통째로 다루고 있어 사실상 중복입니다. 다만 캐시 키 정책을 바꾸는 일이라 의도를 모른 채 건드리지 않았고, 원하시면 그 방향으로 바꾸겠습니다.

#249에서 먼저 여쭤봤는데 답이 없어서, 지금 CI를 막고 있는 상태라 일단 최소 수정으로 올립니다. 방향이 다르면 닫겠습니다.

@coderabbitai

coderabbitai Bot commented Jul 26, 2026

Copy link
Copy Markdown

Warning

Review limit reached

@DPS0340, you've reached your PR review limit, so we couldn't start this review.

Next review available in: 34 minutes

Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available.
You're only billed for reviews past your plan's rate limits ($0.25/file).

How can I continue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews.

How do review limits work?

CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability.

For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window.

Please refer docs for additional details.

Review details
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: 70b897ea-7349-43ee-91f4-d971b4fed0a3

📥 Commits

Reviewing files that changed from the base of the PR and between e49943e and c13b857.

📒 Files selected for processing (1)
  • .github/workflows/coverage.yml
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@DPS0340

DPS0340 commented Jul 26, 2026

Copy link
Copy Markdown
Contributor Author

CI 결과가 나왔습니다. 이 PR의 Rust project 잡이 통과합니다.

#250 (this)  Rust project: success
#241         Rust project: success
#242         Rust project: success
#246         Rust project: success
#247         Rust project: failure  ← 같은 tarpaulin 캐시 에러

#247은 지금도 error: binary cargo-tarpaulin already exists in destination으로 죽고 있고, 이 PR은 같은 워크플로를 --force 하나만 바꿔서 초록불입니다.

다만 정직하게 덧붙이면 — 이 PR이 통과한 것만으로 인과가 증명되진 않습니다. tarpaulin 캐시가 살아 있는 실행이면 원래도 통과하니까요. 인과의 근거는 로컬 재현 쪽입니다:

cargo install cargo-audit --locked          → already installed, use --force to override
cargo install cargo-audit --locked --force  → Replacing ... (성공)

캐시가 미스인 상태에서 바이너리가 이미 있으면 --force 없이는 반드시 101로 죽고, 붙이면 성공합니다.

coverage.yml has two cache steps that overlap on the same path:

  Cache Cargo's directories  path: ~/.cargo/bin/   (matches via restore-keys)
  Cache cargo-tarpaulin      path: ~/.cargo/bin/cargo-tarpaulin  (exact key)

The first restores the whole bin directory, cargo-tarpaulin included. The
second needs an exact key match, so once Linux-tarpaulin-v0.30 is evicted it
misses, the install step runs against a binary that is already there, and
cargo aborts:

  error: binary `cargo-tarpaulin` already exists in destination
  Process completed with exit code 101

Verified locally with an already-installed crate:

  cargo install cargo-audit --locked
    Ignored package `cargo-audit v0.22.2` is already installed, use --force to override
  cargo install cargo-audit --locked --force
    Replacing /Users/lee/.cargo/bin/cargo-audit  → succeeds

Reported as myyrakle#249.
@DPS0340
DPS0340 force-pushed the fix/tarpaulin-cache-race branch from 6c55b98 to c13b857 Compare July 26, 2026 04:28
@DPS0340

DPS0340 commented Jul 26, 2026

Copy link
Copy Markdown
Contributor Author

#246 머지 이후 재실행 결과입니다. 대비가 더 선명해졌습니다.

두 PR 모두 방금 master 위로 리베이스한 상태에서:

#250 (--force 적용)  Rust project: success
#247 (미적용)        Rust project: failure

#247의 최신 실행 로그도 같은 지점입니다:

Install cargo-tarpaulin
  error: binary `cargo-tarpaulin` already exists in destination
  Process completed with exit code 101

같은 커밋 베이스, 같은 워크플로, 차이는 --force 하나입니다. 이 정도면 캐시 상태의 우연이라고 보기 어렵습니다.

참고로 #247에 붙어 있던 빈 "chore: retrigger CI" 커밋은 제거했습니다. 원인이 러너 캐시 경합이라 재시도가 의미가 없었고, 지금은 실제 수정이 #250에 있습니다.

@myyrakle
myyrakle merged commit 966b402 into myyrakle:master Jul 26, 2026
5 checks passed
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.

[workflow] cargo-tarpaulin 캐시 경합으로 coverage 잡이 간헐 실패합니다

2 participants