Skip to content

Commit 5e68627

Browse files
linesightclaude
andcommitted
Fix Linux CI tests: add --no-sandbox for subprocess launch
CEF's sandbox setup (user namespace or chrome-sandbox SETUID) fails on GitHub Actions runners, causing execvp to fail for every subprocess type. Add --no-sandbox to Linux test switches so CEF launches subprocesses directly without sandbox scaffolding. Also chmod +x cefpython3/subprocess in the test job as a safety measure in case artifact transfer drops the execute bit. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
1 parent 2d118be commit 5e68627

3 files changed

Lines changed: 14 additions & 2 deletions

File tree

.github/workflows/ci-linux.yml

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,9 @@ jobs:
4040
uses: actions/cache@v4
4141
if: ${{ inputs.bypass_cache != true }}
4242
with:
43-
path: build/cef_binary_*
43+
path: |
44+
build/cef_binary_*
45+
build/cef*_linux64
4446
key: cef-linux64-${{ steps.cef-version.outputs.value }}
4547

4648
- name: Install system dependencies
@@ -120,7 +122,9 @@ jobs:
120122
path: build/artifacts/
121123

122124
- name: Set up cefpython3 package for testing
123-
run: cp -r build/artifacts/. cefpython3/
125+
run: |
126+
cp -r build/artifacts/. cefpython3/
127+
chmod +x cefpython3/subprocess
124128
125129
- name: Run unit tests
126130
run: xvfb-run python unittests/_test_runner.py

unittests/main_test.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -143,6 +143,10 @@ def test_main(self):
143143
settings["log_severity"] = cef.LOGSEVERITY_WARNING
144144
# Chrome 130+ blocks window.open() called without a user gesture.
145145
switches = {"disable-popup-blocking": ""}
146+
if LINUX:
147+
# Sandbox setup (user-namespace) fails on CI runners; GPU process
148+
# also needs --no-sandbox to launch successfully under xvfb.
149+
switches["no-sandbox"] = ""
146150
cef.Initialize(settings, switches=switches)
147151
subtest_message("cef.Initialize() ok")
148152

unittests/osr_test.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -112,6 +112,10 @@ def test_osr(self):
112112
"enable-begin-frame-scheduling": "",
113113
"disable-surfaces": "", # This is required for PDF ext to work
114114
}
115+
if LINUX:
116+
# Sandbox setup fails on CI runners; subprocess won't launch
117+
# without this under xvfb even with --disable-gpu.
118+
switches["no-sandbox"] = ""
115119
browser_settings = {
116120
# Tweaking OSR performance (Issue #240)
117121
"windowless_frame_rate": 30, # Default frame rate in CEF is 30

0 commit comments

Comments
 (0)