Skip to content

test_read_yaml flakes with HuggingFace Hub 429 in CI #1193

Description

@planetf1

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:

Observed in

PR #1158 CI run — code-checks / quality (3.11, 3.12, 3.13) all failed on this test on 2026-06-02.

Metadata

Metadata

Assignees

Labels

bugSomething isn't workingtesting

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions