Repository navigation
Retry link checks on 429/503 to fix flaky ci - #25
Merged
Merged
Conversation
docs.unity3d.com rate-limits HEAD requests, making the test command report valid links as invalid and CommandTests fail intermittently. Retry up to 5 attempts, honoring Retry-After or backing off 1/2/4/8s (capped at 60s). No log per retry: tests assert zero log records. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_015PW29oEyQ3Jh7amkT1sjAi
Default 5 (Constants.DefaultMaxAttempts); values below 1 are rejected. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_015PW29oEyQ3Jh7amkT1sjAi
- Backoff uses named constants and Math.Min instead of a bit shift, which overflowed from attempt 32 (negative delay clamped to zero). - UtilsTests: local HttpListener answers 429 twice, then 200; checks request count and result for maxAttempts 2 and 3. - README: document retries and --maxAttempts. - Move retry fields next to s_httpClient. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_015PW29oEyQ3Jh7amkT1sjAi
Owner
Author
|
This is this PR's to fix: the retry budget is too small. Waiting on a decision on how to raise it (higher default Generated by Claude Code |
CI on 06f4651 still saw 2 links answer 429 after the default 5 attempts (~15 s of backoff) on GitHub runners. 8 attempts allow up to 123 s per link; the tool default stays 5. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_015PW29oEyQ3Jh7amkT1sjAi
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
cifails intermittently onmain(after #18, #20, #21, #24) and PR runs need re-runs.UnityPackage_BuildTest_Successruns thetestcommand, which HEADs every xref href on docs.unity3d.com; the site answers 429 TooManyRequests, so valid links are reported invalid.#24 is not the cause: it only touches the
Deploy pagesstep ofunity-xref-maps.yml.Change
Utils.TestUriExists:--maxAttemptsrequests in totalRetry-After(delta or date) if present, else exponential backoff 1, 2, 4… s; capped at 60 s (no overflow at high attempt counts)CommandTestsassert zero log recordstestcommand: new--maxAttemptsoption, default 5 (Constants.DefaultMaxAttempts), values below 1 rejected.CommandTestspass--maxAttempts 8(TestMaxAttempts, up to 123 s of backoff per link): with the default 5, CI on 06f4651 still had 2 links at 429 on GitHub runners. They still check real URLs (the HTTP-mocking approach was reverted in 8a62bb1).New
UtilsTests: a localHttpListeneranswers 429 (Retry-After: 0) twice, then 200; checks result and request count formaxAttempts2 and 3.README documents retries and
--maxAttempts.Verification
dotnet build -c Release: 0 warnings.dotnet test -c ReleasewithTestMaxAttempts: 13/13 on 2 full runs; 1 earlier run had 1 failure whose output was not captured (noTooManyRequestsin it).UtilsTestsfail (2/2) with retries disabled, pass with them.testcommand against a local server:--maxAttempts 2--maxAttempts 0--maxAttempts must be at least 1.Not verified: whether docs.unity3d.com sends
Retry-Afterwith its 429 — 620 HEAD requests from a non-GitHub IP never triggered a 429. The code falls back to exponential backoff when the header is absent.🤖 Generated with Claude Code
https://claude.ai/code/session_015PW29oEyQ3Jh7amkT1sjAi