Skip to content

fix(extractor): cap downloader retry budget to keep CI test runtime sane#318

Merged
SimplicityGuy merged 1 commit intomainfrom
feature/fix-test-retry-delays
Apr 29, 2026
Merged

fix(extractor): cap downloader retry budget to keep CI test runtime sane#318
SimplicityGuy merged 1 commit intomainfrom
feature/fix-test-retry-delays

Conversation

@SimplicityGuy
Copy link
Copy Markdown
Owner

Summary

PR #317 raised both downloaders' transport-error retry budget from 3 attempts at 2s base to 5 attempts at 30s base. The intent was rate-limit politeness, but rate-limit handling actually lives in `polite_http` and never reaches this loop — only post-connect transport errors do (partial reads, flush/sync errors, mid-stream drops).

Side effect: integration tests in `tests/http_integration_test.rs` see `cfg(not(test))` (the `#[cfg(test)]` override only applies when the library itself is being unit-tested, not when external test binaries link against it). Failing-download tests therefore paid the full production backoff:

```
attempt 2: 30s
attempt 3: 60s
attempt 4: 120s
attempt 5: 240s
total: 450s sleeping per test
```

That blew up `http_integration_test` from ~50s on main to 460s locally, and made `test-extractor` time out under `cargo-llvm-cov` in CI on PR #317 (this is the hung CI run that sat pending for ~10+ minutes before timing out).

Fix

Restore the original 3-retry / 2s-base — those are the right numbers for transport-error retry. The polite client owns the rate-limit backoff path with its own server-driven `Retry-After` handling and per-provider caps (2h Discogs, 30m MusicBrainz). No need to also retry slowly here.

Wall time

Suite Before (PR #317) After
`cargo test --test http_integration_test` (sequential) 460s 75s
`cargo test --test http_integration_test` (parallel) timed out in CI 20s
Full `cargo test` hangs in CI passes, all 690+ tests

Test plan

  • `cargo test` — 484 lib + 486 bin + 690 integration tests, all pass
  • `cargo clippy --lib --bin extractor --all-features -- -D warnings` clean
  • `cargo fmt` clean
  • Verified `http_integration_test` completes in ~20s parallel / ~75s sequential

🤖 Generated with Claude Code

PR #317 raised both downloaders' transport-error retry budget from 3
attempts at 2s base to 5 attempts at 30s base. The intent was rate-limit
politeness, but rate-limit handling actually lives in `polite_http` and
never reaches this loop — only post-connect transport errors do
(partial reads, flush/sync errors, mid-stream drops).

Side effect: integration tests in `tests/http_integration_test.rs` see
`cfg(not(test))` (the `#[cfg(test)]` override only applies when the
*library* itself is being unit-tested, not when external test binaries
link against it). Failing-download tests therefore paid the full
production backoff: 30+60+120+240 = 450s sleeping per test.

That blew up `http_integration_test` from ~50s on main to 460s locally,
and made `test-extractor` time out under `cargo-llvm-cov` in CI on
PR #317.

Restoring the original 3-retry / 2s-base — those are the right numbers
for transport-error retry. The polite client owns the rate-limit
backoff path with its own server-driven Retry-After handling and per-
provider caps (2h Discogs, 30m MusicBrainz).

Wall time: `cargo test --test http_integration_test` 460s → 75s
sequentially, 20s parallel.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@codecov
Copy link
Copy Markdown

codecov Bot commented Apr 29, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

@github-actions
Copy link
Copy Markdown
Contributor

E2E Coverage (webkit)

Totals Coverage
Statements: 46.5% ( 1241 / 2669 )
Lines: 46.5% ( 1241 / 2669 )

StandWithUkraine

@github-actions
Copy link
Copy Markdown
Contributor

E2E Coverage (chromium)

Totals Coverage
Statements: 46.5% ( 1241 / 2669 )
Lines: 46.5% ( 1241 / 2669 )

StandWithUkraine

@github-actions
Copy link
Copy Markdown
Contributor

E2E Coverage (firefox)

Totals Coverage
Statements: 46.5% ( 1241 / 2669 )
Lines: 46.5% ( 1241 / 2669 )

StandWithUkraine

@github-actions
Copy link
Copy Markdown
Contributor

E2E Coverage (webkit - iPhone 15)

Totals Coverage
Statements: 46.5% ( 1241 / 2669 )
Lines: 46.5% ( 1241 / 2669 )

StandWithUkraine

@github-actions
Copy link
Copy Markdown
Contributor

E2E Coverage (webkit - iPad Pro 11)

Totals Coverage
Statements: 46.5% ( 1241 / 2669 )
Lines: 46.5% ( 1241 / 2669 )

StandWithUkraine

@SimplicityGuy SimplicityGuy merged commit 800aac4 into main Apr 29, 2026
57 checks passed
@SimplicityGuy SimplicityGuy deleted the feature/fix-test-retry-delays branch April 29, 2026 02:58
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