Skip to content

Commit ea2055c

Browse files
committed
fix(vrt): add --no-sandbox to self-launching rich-text specs; pin Chrome 127
The rich-text-input and localized-rich-text-input visualspecs launch their OWN puppeteer browser (not the jest-puppeteer global one) and did not pass --no-sandbox. On ubuntu-24.04 (AppArmor restricts unprivileged user namespaces) that crashes with 'No usable sandbox', failing those 2 suites and dropping a Percy snapshot. They previously only passed because the removed aa-exec wrapper covered them. Add --no-sandbox/--disable-setuid-sandbox to both launches, matching jest-puppeteer.config.js used by the other 68 specs. Also pin setup-chrome to 127.0.6533.88 (puppeteer 22.15.0's target build and the Percy baseline's browser) instead of 'stable' — 'stable' pulled Chrome 149.
1 parent 5d9018f commit ea2055c

3 files changed

Lines changed: 16 additions & 2 deletions

File tree

.github/workflows/main.yml

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -73,12 +73,16 @@ jobs:
7373
# working in CI and yielded 0 snapshots, so we provision Chrome explicitly
7474
# here and point both tools at it. jest-puppeteer.config.js reads
7575
# PUPPETEER_EXECUTABLE_PATH and launches with --no-sandbox.
76-
# TODO: pin `chrome-version` to a specific build for reproducible snapshots.
76+
#
77+
# Pinned to 127.0.6533.88 — the Chrome build puppeteer 22.15.0 targets and
78+
# the one the Percy baseline was captured with. `chrome-version: stable`
79+
# pulled Chrome 149 (~22 majors newer), which broke 2 visual test suites
80+
# via CDP/runtime drift. Bump this in lockstep with puppeteer.
7781
- name: Set up Chrome
7882
id: setup-chrome
7983
uses: browser-actions/setup-chrome@2e1d749697dd1612b833dba4a722266286fbefcd # v2.1.2
8084
with:
81-
chrome-version: stable
85+
chrome-version: 127.0.6533.88
8286

8387
- name: Running Visual Regression Tests for UI components
8488
run: |

packages/components/inputs/localized-rich-text-input/src/localized-rich-text-input.visualspec.js

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,11 @@ jest.setTimeout(20000);
99
beforeEach(async () => {
1010
browser = await puppeteer.launch({
1111
headless: 'new',
12+
// This spec launches its own browser (not the jest-puppeteer global one), so
13+
// it must opt out of the Chrome sandbox itself. CI runners (Ubuntu 24.04+)
14+
// restrict unprivileged user namespaces via AppArmor, so the sandbox can't
15+
// start otherwise. Matches jest-puppeteer.config.js used by other specs.
16+
args: ['--no-sandbox', '--disable-setuid-sandbox'],
1217
slowMo: 10, // Launching the browser in slow motion is necessary due to race conditions. Otherwise browser closes prematurely and tests fail.
1318
});
1419
page = await browser.newPage();

packages/components/inputs/rich-text-input/src/rich-text-input.visualspec.js

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,11 @@ jest.setTimeout(20000);
99
beforeEach(async () => {
1010
browser = await puppeteer.launch({
1111
headless: 'new',
12+
// This spec launches its own browser (not the jest-puppeteer global one), so
13+
// it must opt out of the Chrome sandbox itself. CI runners (Ubuntu 24.04+)
14+
// restrict unprivileged user namespaces via AppArmor, so the sandbox can't
15+
// start otherwise. Matches jest-puppeteer.config.js used by other specs.
16+
args: ['--no-sandbox', '--disable-setuid-sandbox'],
1217
slowMo: 10, // Launching the browser in slow motion is necessary due to race conditions. Otherwise browser closes prematurely and tests fail.
1318
});
1419
page = await browser.newPage();

0 commit comments

Comments
 (0)