Skip to content

test_read_yaml flakes with HuggingFace Hub 429 in CI #1193

Closed

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.

Activity

  1. added
    bug
    on Jun 3, 2026
  2. self-assigned this
    on Jun 3, 2026
  3. added a commit that references this issue on Jun 3, 2026
    4d076e1
  4. planetf1 commented on Jun 3, 2026

    @planetf1
    ContributorAuthor

    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 by snapshot_download whenever revision="main" is passed.

    test_read_yaml is one instance, but the same 429 hits every YamlJsonCombo fixture that calls _resolve_yaml() (which calls obtain_io_yaml with the default revision="main"). On a bad Hub day this produces 66+ fixture-setup errors, making CI fail regardless of whether test_read_yaml is fixed.

    The effective fix is higher up: _resolve_yaml() should catch LocalEntryNotFoundError and call pytest.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.

  5. added a commit that references this issue on Jun 3, 2026
    1ca02d6
  6. added a commit that references this issue on Jun 3, 2026
    48ce799
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

bugtesting

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions