Skip to content

Make test_urls resilient to rate limiting and to chains added by a branch - #37

Merged
shimwell merged 1 commit into
mainfrom
fix-flaky-url-tests
Aug 18, 2026
Merged

Make test_urls resilient to rate limiting and to chains added by a branch#37
shimwell merged 1 commit into
mainfrom
fix-flaky-url-tests

Conversation

@shimwell

Copy link
Copy Markdown
Member

Why

test_urls has been failing intermittently, including a scheduled run on main on
15 August. It is not the urls. Every one of them returns 200 when requested on its
own, and the file the last failure complained about is on main:

endf b7.1 .../raw/main/src/openmc_data/depletion/chain_endf_b7.1.xml None 404
FAILED tests/test_urls.py::test_xml_urls - assert 404 == 200

chain_endf_b7.1.xml is there, 27737271 bytes, and the url returns 200 right now.
The suite requests hundreds of files in one job and GitHub starts refusing them.
The same run logged it plainly:

Failed to download action ... Error: Response status code does not indicate
success: 429 (Too Many Requests).

test_convert_scripts failed in the same run for the same reason.

What this changes

Transient failures are retried with a growing wait before being treated as
real, so a refusal under load no longer fails the run.

Chain files kept in this repository are checked on disk rather than fetched
from main. This also removes a chicken and egg problem: a chain file added by a
pull request is not on main until that branch merges, so test_xml_urls could
never pass for the very change that adds it. That is why #27 could not go green
when it added the ENDF/B-VIII.1 chains, and why #36 is red now. Checking the path
on disk tests the same thing, that the url in the registry corresponds to a real
file.

A wrong path is still caught:

https://.../chain_does_not_exist.xml points at
/home/jon/openmc_data_ciflake/src/openmc_data/depletion/chain_does_not_exist.xml
which is missing

Checks

…anch

test_urls has been failing intermittently, including a scheduled run on main on
15 August. The urls themselves are fine, every one of them returns 200 when
requested on its own. The suite asks for hundreds of files in a single job and
GitHub starts refusing them, which shows up as an explicit
"429 (Too Many Requests)" in the logs and as an occasional 404 on a file that
definitely exists.

Two changes:

- a failed request is retried with a growing wait before it is treated as real,
  so a transient refusal no longer fails the run

- the chain files kept in this repository are checked on disk instead of being
  fetched from main. This also fixes a chicken and egg problem, as a chain file
  added by a pull request is not on main until that branch is merged, so the
  test could not pass for the very change that adds it. Checking the path on
  disk tests the same thing, that the url in the registry corresponds to a real
  file, and a wrong path is still caught.
@shimwell
shimwell merged commit d9cec01 into main Aug 18, 2026
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant