From 241ca72f0e744b1e6c08e78d0f15f22eb74a30e6 Mon Sep 17 00:00:00 2001 From: Eoghan Murray Date: Wed, 1 Apr 2026 12:00:00 +0800 Subject: [PATCH] Testing: disable puppeteer/chrome sandbox in Github Actions for Ubuntu 24.04 (#1657) --disable-setuid-sandbox deemed acceptable by Yun as it's for Github Actions only --- .changeset/famous-bobcats-push.md | 2 ++ .github/workflows/ci-cd.yml | 2 +- packages/all/test/utils.ts | 2 +- .../plugins/rrweb-plugin-console-record/test/index.test.ts | 2 +- packages/rrdom/test/diff.test.ts | 4 +++- packages/rrdom/test/virtual-dom.test.ts | 4 +++- packages/rrweb-snapshot/test/integration.test.ts | 4 ++++ packages/rrweb/test/utils.ts | 2 +- 8 files changed, 16 insertions(+), 6 deletions(-) create mode 100644 .changeset/famous-bobcats-push.md diff --git a/.changeset/famous-bobcats-push.md b/.changeset/famous-bobcats-push.md new file mode 100644 index 00000000..a845151c --- /dev/null +++ b/.changeset/famous-bobcats-push.md @@ -0,0 +1,2 @@ +--- +--- diff --git a/.github/workflows/ci-cd.yml b/.github/workflows/ci-cd.yml index be374037..cb43a726 100644 --- a/.github/workflows/ci-cd.yml +++ b/.github/workflows/ci-cd.yml @@ -9,7 +9,7 @@ jobs: name: Tests permissions: contents: read - runs-on: ubuntu-22.04 + runs-on: ubuntu-latest steps: - name: Checkout Repo uses: actions/checkout@v3 diff --git a/packages/all/test/utils.ts b/packages/all/test/utils.ts index 7947be91..ea791bc0 100644 --- a/packages/all/test/utils.ts +++ b/packages/all/test/utils.ts @@ -24,7 +24,7 @@ export async function launchPuppeteer( width: 1920, height: 1080, }, - args: ['--no-sandbox'], + args: ['--no-sandbox', '--disable-setuid-sandbox'], ...options, }); } diff --git a/packages/plugins/rrweb-plugin-console-record/test/index.test.ts b/packages/plugins/rrweb-plugin-console-record/test/index.test.ts index b133a39f..c771a77b 100644 --- a/packages/plugins/rrweb-plugin-console-record/test/index.test.ts +++ b/packages/plugins/rrweb-plugin-console-record/test/index.test.ts @@ -14,7 +14,7 @@ export async function launchPuppeteer( width: 1920, height: 1080, }, - args: ['--no-sandbox'], + args: ['--no-sandbox', '--disable-setuid-sandbox'], ...options, }); } diff --git a/packages/rrdom/test/diff.test.ts b/packages/rrdom/test/diff.test.ts index bcd42ffa..0b13edb4 100644 --- a/packages/rrdom/test/diff.test.ts +++ b/packages/rrdom/test/diff.test.ts @@ -1413,7 +1413,9 @@ describe('diff algorithm for rrdom', () => { * If the selector match is case insensitive, it will cause some CSS style problems in the replayer. * This test result executed in JSDom is different from that in real browser so we use puppeteer as test environment. */ - const browser = await puppeteer.launch(); + const browser = await puppeteer.launch({ + args: ['--no-sandbox', '--disable-setuid-sandbox'], + }); const page = await browser.newPage(); await page.goto('about:blank'); diff --git a/packages/rrdom/test/virtual-dom.test.ts b/packages/rrdom/test/virtual-dom.test.ts index 9740cc7c..d956b8e0 100644 --- a/packages/rrdom/test/virtual-dom.test.ts +++ b/packages/rrdom/test/virtual-dom.test.ts @@ -242,7 +242,9 @@ describe('RRDocument for browser environment', () => { let page: puppeteer.Page; beforeAll(async () => { - browser = await puppeteer.launch(); + browser = await puppeteer.launch({ + args: ['--no-sandbox', '--disable-setuid-sandbox'], + }); code = fs.readFileSync( path.resolve(__dirname, '../dist/rrdom.umd.cjs'), 'utf8', diff --git a/packages/rrweb-snapshot/test/integration.test.ts b/packages/rrweb-snapshot/test/integration.test.ts index 9fa04baf..1cc6acff 100644 --- a/packages/rrweb-snapshot/test/integration.test.ts +++ b/packages/rrweb-snapshot/test/integration.test.ts @@ -103,6 +103,7 @@ describe('integration tests', function (this: ISuite) { serverURL = getServerURL(server); browser = await puppeteer.launch({ // headless: false, + args: ['--no-sandbox', '--disable-setuid-sandbox'], }); code = fs.readFileSync( @@ -435,6 +436,7 @@ describe('iframe integration tests', function (this: ISuite) { serverURL = getServerURL(server); browser = await puppeteer.launch({ // headless: false, + args: ['--no-sandbox', '--disable-setuid-sandbox'], }); code = fs.readFileSync( @@ -479,6 +481,7 @@ describe('dialog integration tests', function (this: ISuite) { serverURL = getServerURL(server); browser = await puppeteer.launch({ // headless: false, + args: ['--no-sandbox', '--disable-setuid-sandbox'], }); code = fs.readFileSync( @@ -525,6 +528,7 @@ describe('shadow DOM integration tests', function (this: ISuite) { serverURL = getServerURL(server); browser = await puppeteer.launch({ // headless: false, + args: ['--no-sandbox', '--disable-setuid-sandbox'], }); code = fs.readFileSync( diff --git a/packages/rrweb/test/utils.ts b/packages/rrweb/test/utils.ts index 9699543a..d8463591 100644 --- a/packages/rrweb/test/utils.ts +++ b/packages/rrweb/test/utils.ts @@ -26,7 +26,7 @@ export async function launchPuppeteer( width: 1920, height: 1080, }, - args: ['--no-sandbox'], + args: ['--no-sandbox', '--disable-setuid-sandbox'], ...options, }); }