Skip to content

fix: rename_retry helper for Windows flaky relocation tests#105

Merged
flupkede merged 2 commits into
developfrom
fix/test-rename-retry-windows
Jun 2, 2026
Merged

fix: rename_retry helper for Windows flaky relocation tests#105
flupkede merged 2 commits into
developfrom
fix/test-rename-retry-windows

Conversation

@flupkede
Copy link
Copy Markdown
Owner

@flupkede flupkede commented Jun 2, 2026

Summary

  • Windows: flaky relocation tests eliminatedstd::fs::rename fails intermittently under parallel test load on Windows because git subprocesses from init_git_remote briefly keep file handles open after exit.
  • Added rename_retry() test helper that retries up to 10 times with exponential back-off (20–200 ms delays).
  • Replaced all 7 std::fs::rename(...).unwrap() calls in the repos test module with rename_retry().
  • Changed one remove_dir_all(...).unwrap() to let _ = ... (assertion holds either way).
  • Verified stable: 3 consecutive full-suite runs, 432 passed, 0 failed.

Test plan

  • cargo fmt --check — PASSED
  • cargo check --all-targets — PASSED
  • cargo clippy --all-targets -- -D warnings — PASSED
  • cargo test --lib × 3 — 432 passed, 0 failed each run

🤖 Generated with Claude Code

flupkede and others added 2 commits June 2, 2026 21:55
On Windows, git subprocesses spawned by init_git_remote keep file handles
open briefly after the process exits, causing std::fs::rename and
std::fs::remove_dir_all to fail with "Access is denied" under parallel test
load. Fixes:
- Add rename_retry() test helper that retries with exponential back-off
  (up to 10 attempts, 20-200ms delays)
- Replace all 7 std::fs::rename(...).unwrap() calls in the repos test
  module with rename_retry()
- Change remove_dir_all(...).unwrap() in try_relocate_none_when_ambiguous
  to let _ = ... (the assertion holds either way)

Verified stable: 3 consecutive full-suite runs with 432 passed, 0 failed.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@flupkede flupkede merged commit 8f3a62f into develop Jun 2, 2026
1 check 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.

1 participant