fix(ci): tune apt timeouts to fail fast on stalled CI mirror connections - #1263
Merged
Conversation
The bash timeout/retry loop wrapping npx playwright install --with-deps (added previously to stop apt hangs from burning the job's full 60-minute timeout) still lost all 3 retry attempts to the same degraded connection in a recent run: apt wasn't erroring or fully stalled with zero progress, it was crawling at near-zero throughput on azure.archive.ubuntu.com -- one package's download sat idle for over 5 minutes before the next one even started, so each 10-minute attempt timed out against the same slow mirror with no actual retry benefit. Write an apt.conf.d drop-in before the first browser install in each job, setting Acquire::Retries/Acquire::http::Timeout/Acquire::https::Timeout to bounded values (3 retries, 15s timeout). This makes apt itself detect and abandon a stalled connection within seconds and retry against a fresh one, instead of sitting on one bad connection for the whole outer 10-minute budget -- so our existing 3-attempt outer loop actually gets a chance to succeed against a different connection attempt, rather than exhausting all 3 attempts on the same degraded path.
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
Contributor
|
You are seeing this message because GitHub Code Scanning has recently been set up for this repository, or this pull request contains the workflow file for the Code Scanning tool. What Enabling Code Scanning Means:
For more information about GitHub Code Scanning, check out the documentation. |
Contributor
|
| Severity | Count |
|---|---|
| 🔴 Critical | 0 |
| 🟠 High | 2 |
| 🟡 Medium | 5 |
| 🟢 Low | 2 |
| Total | 13 |
📎 Artifacts
- SBOM (CycloneDX JSON) and Grype results available in workflow artifacts
Generated by Supply Chain Verification workflow • View Details
This was referenced Aug 19, 2026
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.
Summary
The bash
timeout/retry loop wrappingnpx playwright install --with-deps(added in #1259 to stop apt hangs from burning the job's full 60-minute timeout) still lost all 3 retry attempts to the same degraded connection in a recent run (job):apt wasn't erroring or fully stalled with zero progress (the original bug #1259 fixed) — it was crawling at near-zero throughput on
azure.archive.ubuntu.com. Since our outer retry loop doesn't change which connection/mirror apt uses, all 3 attempts hit the same degraded path and all 3 timed out, with no actual retry benefit.Fix
Write an
apt.conf.ddrop-in before the first browser install in each of the 6 E2E jobs, setting:This makes apt itself detect and abandon a stalled connection within 15s and retry against a fresh one, instead of sitting on one bad connection for the whole 10-minute outer budget — so the existing 3-attempt outer loop actually gets a chance to succeed against a different connection, rather than exhausting all 3 attempts on the same degraded path.
Test plan
actionlintclean (including shellcheck validation of the embedded heredoc)lefthook run pre-commitclean