Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 10 additions & 2 deletions .github/workflows/fork-free-suite.yml
Original file line number Diff line number Diff line change
Expand Up @@ -137,12 +137,20 @@ jobs:
id: playwright_install
timeout-minutes: 5
continue-on-error: true
run: npx playwright install --with-deps chromium
run: |
# Wait for a held apt/dpkg lock instead of failing at once (exit 100
# when a timed-out first attempt still holds it; CHE-9158).
echo 'DPkg::Lock::Timeout "180";' | sudo tee /etc/apt/apt.conf.d/99-lock-timeout > /dev/null
npx playwright install --with-deps chromium

- name: Retry the Playwright Chromium install once
if: steps.playwright_install.outcome == 'failure'
timeout-minutes: 5
run: npx playwright install --with-deps chromium
run: |
# Wait for a held apt/dpkg lock instead of failing at once (exit 100
# when a timed-out first attempt still holds it; CHE-9158).
echo 'DPkg::Lock::Timeout "180";' | sudo tee /etc/apt/apt.conf.d/99-lock-timeout > /dev/null
npx playwright install --with-deps chromium

- name: Configure the bundled Chromium sandbox helper
run: |
Expand Down
24 changes: 20 additions & 4 deletions .github/workflows/free-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -482,11 +482,19 @@ jobs:
id: playwright_install
timeout-minutes: 5
continue-on-error: true
run: npx playwright install --with-deps chromium
run: |
# Wait for a held apt/dpkg lock instead of failing at once (exit 100
# when a timed-out first attempt still holds it; CHE-9158).
echo 'DPkg::Lock::Timeout "180";' | sudo tee /etc/apt/apt.conf.d/99-lock-timeout > /dev/null
npx playwright install --with-deps chromium
- name: Retry the Playwright Chromium install once
if: steps.playwright_install.outcome == 'failure'
timeout-minutes: 5
run: npx playwright install --with-deps chromium
run: |
# Wait for a held apt/dpkg lock instead of failing at once (exit 100
# when a timed-out first attempt still holds it; CHE-9158).
echo 'DPkg::Lock::Timeout "180";' | sudo tee /etc/apt/apt.conf.d/99-lock-timeout > /dev/null
npx playwright install --with-deps chromium
- name: Configure the bundled Chromium sandbox helper
run: |
set -euo pipefail
Expand Down Expand Up @@ -605,12 +613,20 @@ jobs:
id: playwright_install
timeout-minutes: 5
continue-on-error: true
run: npx playwright install --with-deps chromium
run: |
# Wait for a held apt/dpkg lock instead of failing at once (exit 100
# when a timed-out first attempt still holds it; CHE-9158).
echo 'DPkg::Lock::Timeout "180";' | sudo tee /etc/apt/apt.conf.d/99-lock-timeout > /dev/null
npx playwright install --with-deps chromium

- name: Retry the Playwright Chromium install once
if: steps.playwright_install.outcome == 'failure'
timeout-minutes: 5
run: npx playwright install --with-deps chromium
run: |
# Wait for a held apt/dpkg lock instead of failing at once (exit 100
# when a timed-out first attempt still holds it; CHE-9158).
echo 'DPkg::Lock::Timeout "180";' | sudo tee /etc/apt/apt.conf.d/99-lock-timeout > /dev/null
npx playwright install --with-deps chromium

- name: Configure the bundled Chromium sandbox helper
run: |
Expand Down
23 changes: 23 additions & 0 deletions test/fork-free-suite-workflow.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -69,3 +69,26 @@ describe('fork free-suite workflow', () => {
expect(JSON.stringify(agg.steps)).toContain('--ci-verify');
});
});

// CHE-9158: a timed-out first Chromium install can still hold the apt/dpkg lock
// when the retry starts (run 44265868267, retry exited 100 two seconds later).
// Every Playwright install step must set a dpkg lock timeout before it runs.
describe('Playwright Chromium install steps wait for the apt lock', () => {
for (const [label, file] of [['fork', FORK], ['upstream', UPSTREAM]] as const) {
test(`${label}: each install step sets DPkg::Lock::Timeout first`, () => {
const wf = Bun.YAML.parse(fs.readFileSync(file, 'utf-8')) as any;
const installs: string[] = [];
for (const job of Object.values<any>(wf.jobs)) {
for (const step of job.steps ?? []) {
const run = String(step.run ?? '');
if (!run.includes('playwright install --with-deps')) continue;
installs.push(step.name);
const lock = run.indexOf('DPkg::Lock::Timeout');
expect(lock, step.name).toBeGreaterThanOrEqual(0);
expect(lock, step.name).toBeLessThan(run.indexOf('playwright install'));
}
}
expect(installs.length).toBeGreaterThanOrEqual(2);
});
}
});
7 changes: 6 additions & 1 deletion test/free-tests-workflow-wiring.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -234,7 +234,12 @@ describe('free-tests workflow wiring', () => {
expect(retry, name).toBe(install + 1);
for (const step of [steps[install], steps[retry]]) {
expect(step['timeout-minutes'], name).toBe(5);
expect(step.run, name).toBe('npx playwright install --with-deps chromium');
// CHE-9158: apt waits for the dpkg lock first; the install command stays the last line.
const lines = String(step.run).trim().split('\n').filter((line: string) => !line.startsWith('#'));
expect(lines, name).toEqual([
`echo 'DPkg::Lock::Timeout "180";' | sudo tee /etc/apt/apt.conf.d/99-lock-timeout > /dev/null`,
'npx playwright install --with-deps chromium',
]);
}
expect(steps[install]['continue-on-error'], name).toBe(true);
const failOpen = name === 'free-suite' ? [steps[install], steps.find((step: any) => step.name === 'Upload shard JUnit reports')] : [steps[install]];
Expand Down
Loading