Files
kevinveenbirkenbachandClaude Opus 5.5 1fd033abe8 fix(update): retry dnf makecache through a CentOS mirror push
A CentOS Stream mirror mid-push serves a repomd.xml naming repodata it already removed. dnf's own retries give up on the 404, so every CentOS job in that window failed at the metadata refresh (PR 2842 Blender#0, PR 2864 translate#2, PR 2846, 16:24 UTC 2026-11-24). The refresh now retries until dnf succeeds, 10 times 30 s apart. Under dnf5, ansible.builtin.dnf's update_cache expires no repo, which is why the explicit makecache --refresh runs at all; that reason moves from the dropped task comment into this message.

🎯 Fix: 88 %
💥 Break: 3 %
💸 Tokens: 100 %
⏱️ Velocity: 100 %
🛡️ Security: 100 %
🏆 Score: 85
🚦 Gate: ⛔ fix 88 % < 90

Created-with: https://s.veen.world/skills
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-24 18:51:44 +00:00

33 lines
857 B
Python

import unittest
from utils import PROJECT_ROOT
from utils.cache.yaml import load_yaml_any
TASKS = PROJECT_ROOT / "roles/update/tasks/fedora.yml"
MAKECACHE = ["dnf", "makecache", "--refresh", "-y"]
MIRROR_PUSH_SECONDS = 300
def makecache_task():
return next(
task
for task in load_yaml_any(str(TASKS))
if task.get("ansible.builtin.command", {}).get("argv") == MAKECACHE
)
class FedoraMetadataRefreshTests(unittest.TestCase):
def test_the_metadata_refresh_retries_until_dnf_succeeds(self):
task = makecache_task()
self.assertEqual(task["until"], f"{task['register']}.rc == 0")
def test_the_retries_outlast_a_mirror_push(self):
task = makecache_task()
self.assertGreaterEqual(task["retries"] * task["delay"], MIRROR_PUSH_SECONDS)
if __name__ == "__main__":
unittest.main()