Make test_urls resilient to rate limiting and to chains added by a branch - #37
Merged
Conversation
…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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Why
test_urlshas been failing intermittently, including a scheduled run on main on15 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:
chain_endf_b7.1.xmlis 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:
test_convert_scriptsfailed 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_urlscouldnever 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:
Checks
test_xml_urlspasses on this branch, and the 12 repository chains resolve withno network request at all, leaving only the two openmc_activator urls fetched
pass, so that PR goes green once this is merged