Add dnf retry loop to Dockerfile-base.el9 to reduce CI flakiness#539
Add dnf retry loop to Dockerfile-base.el9 to reduce CI flakiness#539mason-sharp wants to merge 1 commit into
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (1)
🚧 Files skipped from review as they are similar to previous changes (1)
📝 WalkthroughWalkthroughChangesDNF installation reliability
Poem
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 inconclusive)
✅ Passed checks (4 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
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. Comment |
Up to standards ✅🟢 Issues
|
There was a problem hiding this comment.
🧹 Nitpick comments (1)
tests/docker/Dockerfile-base.el9 (1)
68-77: 🩺 Stability & Availability | 🔵 Trivial | ⚡ Quick winClear DNF metadata cache on failure to improve retry resilience.
Transient DNF failures in CI are frequently caused by corrupted or partially downloaded repository metadata, meaning subsequent retries may fail repeatedly if they reuse the same broken cache. Clearing the metadata ensures a fresh fetch from the mirror on the next attempt.
tests/docker/Dockerfile-base.el9#L68-L77: Adddnf clean metadata || true; \before thesleep 5command to ensure the next loop iteration fetches fresh metadata.tests/docker/Dockerfile-base.el9#L96-L143: Add the same metadata cleanup step before the sleep command in this dependency installation loop.♻️ Proposed fixes
For
tests/docker/Dockerfile-base.el9#L68-L77:- if [ "$i" -eq 5 ]; then echo "dnf failed after 5 attempts" >&2; exit 1; fi; \ - echo "dnf attempt $i failed; retrying in 5s..." >&2; \ + if [ "$i" -eq 5 ]; then echo "dnf failed after 5 attempts" >&2; exit 1; fi; \ + echo "dnf attempt $i failed; clearing metadata and retrying in 5s..." >&2; \ + dnf clean metadata || true; \ sleep 5; \For
tests/docker/Dockerfile-base.el9#L96-L143:- if [ "$i" -eq 5 ]; then echo "dnf failed after 5 attempts" >&2; exit 1; fi; \ - echo "dnf attempt $i failed; retrying in 5s..." >&2; \ + if [ "$i" -eq 5 ]; then echo "dnf failed after 5 attempts" >&2; exit 1; fi; \ + echo "dnf attempt $i failed; clearing metadata and retrying in 5s..." >&2; \ + dnf clean metadata || true; \ sleep 5; \🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@tests/docker/Dockerfile-base.el9` around lines 68 - 77, Update both retry loops in tests/docker/Dockerfile-base.el9 at lines 68-77 and 96-143: before each existing sleep 5 command, run dnf clean metadata || true so cleanup failures do not abort the build and the next attempt fetches fresh metadata.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Nitpick comments:
In `@tests/docker/Dockerfile-base.el9`:
- Around line 68-77: Update both retry loops in tests/docker/Dockerfile-base.el9
at lines 68-77 and 96-143: before each existing sleep 5 command, run dnf clean
metadata || true so cleanup failures do not abort the build and the next attempt
fetches fresh metadata.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro
Run ID: 4e0b0e87-3f3d-46e0-9f75-129ef270184d
📒 Files selected for processing (1)
tests/docker/Dockerfile-base.el9
…duce CI flakiness
6138699 to
4b34a1f
Compare
No description provided.