Skip to content

fix(ci): tune apt timeouts to fail fast on stalled CI mirror connections - #1263

Merged
Wikid82 merged 1 commit into
mainfrom
fix/apt-reliability-timeout-hardening
Aug 19, 2026
Merged

fix(ci): tune apt timeouts to fail fast on stalled CI mirror connections#1263
Wikid82 merged 1 commit into
mainfrom
fix/apt-reliability-timeout-hardening

Conversation

@Wikid82

@Wikid82 Wikid82 commented Aug 19, 2026

Copy link
Copy Markdown
Owner

Summary

The bash timeout/retry loop wrapping npx 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):

12:14:24  Get:2 ... fonts-ipafont-gothic ... [3513 kB]
12:19:31  Get:3 ... fonts-freefont-ttf ... [5641 kB]   ← 5+ min for the next package to even start
12:24:16  timeout fires (10 min elapsed)

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.d drop-in before the first browser install in each of the 6 E2E jobs, setting:

Acquire::Retries "3";
Acquire::http::Timeout "15";
Acquire::https::Timeout "15";

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

  • actionlint clean (including shellcheck validation of the embedded heredoc)
  • Confirmed the YAML block-scalar indentation produces a correctly-terminated heredoc (parsed the actual script content via PyYAML to verify)
  • lefthook run pre-commit clean

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

codecov Bot commented Aug 19, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

@github-advanced-security

Copy link
Copy Markdown
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:

  • The 'Security' tab will display more code scanning analysis results (e.g., for the default branch).
  • Depending on your configuration and choice of analysis tool, future pull requests will be annotated with code scanning analysis results.
  • You will be able to see the analysis results for the pull request's branch on this overview once the scans have completed and the checks have passed.

For more information about GitHub Code Scanning, check out the documentation.

@github-actions

Copy link
Copy Markdown
Contributor

⚠️ Supply Chain Verification Results

⚠️ WARNING

📦 SBOM Summary

  • Components: 1753

🔍 Vulnerability Scan

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

@Wikid82
Wikid82 merged commit 3bcb22d into main Aug 19, 2026
47 of 48 checks passed
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.

2 participants