Repository navigation
Description
Problem
test/formatters/granite/test_intrinsics_formatters.py::test_read_yaml fails intermittently in CI with a 429 / rate-limit error from the HuggingFace Hub:
```
requests.exceptions.HTTPError: 429 Client Error: Too Many Requests
for url: https://huggingface.co/api/models/ibm-granite/granitelib-rag-r1.0/revision/main
huggingface_hub.errors.LocalEntryNotFoundError: An error happened while trying to locate
the files on the Hub and we cannot find the appropriate snapshot folder for the specified
revision on the local disk. Please check your internet connection and try again.
```
The failure is caused by this call at the end of the test:
```python
local_path = intrinsics_util.obtain_io_yaml(
"answerability", "granite-4.0-micro", _RAG_INTRINSICS_REPO_NAME
)
```
obtain_io_yaml resolves revision="main" (the default) by hitting the HuggingFace Hub API to resolve the branch tip to a commit SHA — an extra round-trip that is susceptible to rate-limiting. When 429 is returned and there is no local cached snapshot, huggingface_hub raises LocalEntryNotFoundError and the test fails.
The test has no @pytest.mark.huggingface, @pytest.mark.network, or @pytest.mark.block_network marker, and no guard against network failures, so CI treats it as a hard failure rather than an expected flap.
Expected behaviour
The test should either:
- pass a pinned revision SHA to
obtain_io_yamlso the Hub metadata API call is avoided (consistent with the pinning work in fix(intrinsics): pin catalogue entries to HF revision SHAs + deduplicate requirement_check entries (Epic #929 Phase 0) #1135/fix(intrinsics): pin catalogue entries to HF revision SHAs + deduplicate requirement_check (#1135) #1157), or - be marked
@pytest.mark.huggingfaceso it is explicitly classified as a network-dependent test and any transient Hub errors can be handled asxfail.
Observed in
PR #1158 CI run — code-checks / quality (3.11, 3.12, 3.13) all failed on this test on 2026-06-02.
Activity
test(formatters): remove Hub download from test_read_yaml
planetf1 commentedon Jun 3, 2026
Investigated in PR #1194 (now closed). The root error is a 429 on
https://huggingface.co/api/models/ibm-granite/granitelib-rag-r1.0/revision/main— the Hub ref-resolution call made bysnapshot_downloadwheneverrevision="main"is passed.test_read_yamlis one instance, but the same 429 hits everyYamlJsonCombofixture that calls_resolve_yaml()(which callsobtain_io_yamlwith the defaultrevision="main"). On a bad Hub day this produces 66+ fixture-setup errors, making CI fail regardless of whethertest_read_yamlis fixed.The effective fix is higher up:
_resolve_yaml()should catchLocalEntryNotFoundErrorand callpytest.skip()so tests degrade gracefully rather than hard-erroring in fixture setup when Hub is rate-limited. That would fix all affected tests in one place.test(formatters): skip combo fixtures gracefully when Hub returns 429
test(formatters): skip combo fixtures gracefully when Hub returns 429 (…