Repository navigation
[TASK] Stabilize functional tests against Wikimedia rate limiting - #100
Open
SvenJuergens wants to merge 3 commits into
Open
SvenJuergens wants to merge 3 commits into
SvenJuergens wants to merge 3 commits into
Conversation
Wikimedia throttles requests with a generic User-Agent coming from cloud IP ranges (robot policy, https://w.wiki/4wJS), which made fileExistsWithDomainResource fail on GitHub Actions runners.
Wikimedia throttles requests from cloud IP ranges like GitHub Actions runners (robot policy, https://w.wiki/4wJS). When the domain resource is throttled, the placehold fallback serves the file and the tx_filefill_identifier assertion fails. Skip the test in this case instead of reporting a false negative.
Parallel CI jobs share the runner IP pool, so Wikimedia may start throttling between the initial probe and the actual fetch. When the domain resource did not serve the file, probe the remote again and skip instead of failing. Use GET for the probe to mirror the actual fetch request.
|
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.



Problem
The functional test suite fetches real files from
upload.wikimedia.org. Wikimedia enforces its robot policy for requests coming from cloud IP ranges (such as GitHub Actions runners) and throttles them with429 Too many requests/429 Your request does not comply with our robot policy.When the
domainresource is throttled, theplaceholdfallback serves the file instead. Most tests still pass (they only assert non-empty content), butFilefillTest::fileExistsWithDomainResourceasserts that the file was fetched by thedomainresource and fails. This is why the CI onmainis currently red and PR runs fail intermittently.Solution
Two small changes to the test setup only, no production code is touched:
TYPO3, as required by the Wikimedia robot policy.fileExistsWithDomainResourcewhen Wikimedia is not reachable: the test now probes the remote file with a HEAD request first and callsmarkTestSkipped()when it does not answer with200, instead of reporting a false negative. Locally the test still runs and asserts the full behaviour.Verified on a fork with the same workflows: with both changes all matrix jobs are green (example run) — the domain test runs fully when Wikimedia allows it and is skipped transparently when the runner IP is throttled.