mirror of
https://github.com/priyanshujain/sanderling.git
synced 2026-10-02 19:17:10 +00:00
ci(browser): re-enable unprivileged user namespaces for headless Chrome
ubuntu-latest moved to 24.04, whose AppArmor restriction on unprivileged user namespaces stops headless Chrome from opening its DevTools socket even with --no-sandbox, surfacing as the driver's 'websocket url timeout'. Relax the sysctl for the job and add a direct launch check so a future breakage shows Chrome's own stderr rather than an opaque driver timeout.
This commit is contained in:
1 parent
c41e4d0195
commit
96097fb6ea
1 file changed
+15
@@ -98,5 +98,20 @@ jobs:
|
||||
- name: Set up Chrome
|
||||
uses: browser-actions/setup-chrome@v1
|
||||
|
||||
# Ubuntu 24.04 (current ubuntu-latest) restricts unprivileged user
|
||||
# namespaces via AppArmor, which stops headless Chrome from starting even
|
||||
# with --no-sandbox: the process launches but never opens its DevTools
|
||||
# socket. Re-enable them so the driver's Chrome can come up.
|
||||
- name: Allow Chrome under unprivileged user namespaces
|
||||
run: sudo sysctl -w kernel.apparmor_restrict_unprivileged_userns=0
|
||||
|
||||
# Fail here with Chrome's own stderr if the browser can't launch, instead
|
||||
# of letting the driver report an opaque DevTools timeout downstream.
|
||||
- name: Verify headless Chrome starts
|
||||
run: |
|
||||
chrome --version
|
||||
chrome --headless --no-sandbox --disable-gpu --disable-dev-shm-usage \
|
||||
--dump-dom 'data:text/html,<title>ok</title>'
|
||||
|
||||
- name: Drive web fixtures through headless Chrome
|
||||
run: make test-browser
|
||||
Reference in new issue
Block a user