Opened 2 days ago
Closed 36 hours ago
#65722 closed task (blessed) (fixed)
Retry transient Docker image pull failures in PHPUnit workflows
| Reported by: | lancewillett | Owned by: | lancewillett |
|---|---|---|---|
| Priority: | normal | Milestone: | 7.1 |
| Component: | Build/Test Tools | Version: | |
| Severity: | normal | Keywords: | has-patch |
| Cc: | Focuses: |
Description
The reusable PHPUnit workflow starts its Docker environment through npm run env:start. Docker Compose pulls the required images during that step.
Problem
A transient Docker Hub connection timeout currently aborts the job immediately. Reported errors include:
Client.Timeout exceeded while awaiting headers context deadline exceeded
The affected image varies, indicating a registry or network failure rather than an image-specific problem. A large matrix increases the chance that one failed pull fails the run.
Proposed change
Add an explicit image-pull step immediately before environment startup.
The step:
- Pulls
wordpress-develop,php,mysql, andcli. - Adds
memcachedonly when enabled. - Makes at most three pull attempts.
- Waits 10 seconds after the first failure and 20 seconds after the second.
- Reports the error and exits after the third failure.
Successfully pulled images remain locally cached for env:start.
Verification
A real Docker Hub timeout cannot be triggered reliably.
Verification completed:
- Simulated a failed first attempt followed by a successful real pull.
- Confirmed three simulated failures stopped after exactly three attempts.
- Confirmed
memcachedwas included only when enabled. - Started a PHP 8.4 and MySQL 8.4 environment using the cached images.
- Completed
npm run env:install. - Passed
actionlintand workflow whitespace checks.
Possible follow-up
Docker Hub authentication could provide stronger protection and higher pull limits. That requires repository credentials and should be considered separately.
Change History (3)
This ticket was mentioned in PR #12703 on WordPress/wordpress-develop by @lancewillett.
2 days ago
#1
- Keywords has-patch added
![(please configure the [header_logo] section in trac.ini)](/chrome/site/your_project_logo.png)
## Summary
This pre-pulls the Docker images used by the reusable PHPUnit workflow before
env:start.The pull retries at most three times, waiting 10 seconds after the first failure and 20 seconds after the second.
The service list matches the existing Compose context. It pulls
wordpress-develop,php,mysql, andcli, addingmemcachedonly when enabled.## Why
Transient Docker Hub connection timeouts currently fail the affected matrix job immediately. The affected image varies, indicating a registry or network failure rather than an image-specific
problem.
Successfully pulled images remain cached for environment startup.
The real timeout is nondeterministic and was not reproduced.
## Testing
actionlintand workflow whitespace checks.memcachedwas included only when enabled.npm run env:install.## Possible follow-up
Docker Hub authentication could provide stronger protection and higher pull limits. That requires repository credentials and should be considered separately.