Skip to content

ci: clear apt lock between Playwright install-deps retries#119

Merged
iduartgomez merged 3 commits intomainfrom
ci/clear-apt-lock-on-retry
May 6, 2026
Merged

ci: clear apt lock between Playwright install-deps retries#119
iduartgomez merged 3 commits intomainfrom
ci/clear-apt-lock-on-retry

Conversation

@iduartgomez
Copy link
Copy Markdown
Contributor

Summary

Recurring infra flake on PR CI runs (e.g. PR #118): the Playwright `install-deps` retry loop fails permanently because `timeout 240 npx ...` only kills npx, not the spawned `apt-get`. The leftover apt-get holds /var/lib/apt/lists/lock and subsequent retries fail in <1s with "Could not get lock".

Fix:

  • After a failed attempt, kill any lingering apt/apt-get processes
  • Remove apt + dpkg lock files
  • Bump retry sleep 10s → 30s so the previous process is fully gone

Test plan

  • CI green
  • Watch a few PR runs to confirm the flake stops

`timeout 240 npx playwright install-deps` SIGTERMs the npx wrapper
but the spawned `apt-get update` keeps running and holds
/var/lib/apt/lists/lock. Subsequent retry attempts then fail in <1s
with "Could not get lock" — all 3 attempts burn within seconds and
the step fails permanently.

Reap the leftover apt-get and clear the lock files between attempts,
and bump the retry sleep from 10s to 30s so the previous process has
time to fully exit.

Surfaced as a recurring infra flake on PR runs (e.g. PR #118).
The previous 240s budget was below the typical ubicloud apt-mirror
time (apt-get update alone runs 4-5min on these runners). All three
retry attempts in the run on PR #119 timed out at 240s, even though
the prior fix correctly clears the lock between retries.

Bump per-attempt timeout to 10min and drop retries 3 → 2, keeping
the worst-case wall time around 20min (step cap also bumped to 25).
`npx playwright install-deps chromium` invokes `apt-get update` which
hangs 10min+ on ubicloud's apt mirror, blowing past any reasonable
timeout. Install the chromium package list directly with a plain
`apt-get install -y` (skipping update entirely).

Package list extracted from
node_modules/playwright-core/lib/server/registry/nativeDeps.js
under `ubuntu24.04-x64.chromium`. If Playwright bumps the list a
future cache-miss build will fail and we'll catch it.
@iduartgomez iduartgomez merged commit d02c172 into main May 6, 2026
3 checks passed
@iduartgomez iduartgomez deleted the ci/clear-apt-lock-on-retry branch May 6, 2026 11:45
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