fix: add NoSandbox flag to chrome headless that is run during WASM tests, since

this is now required for Ubuntu 23+ and we are using Ubuntu 24+ when running
Github Actions.

See https://chromium.googlesource.com/chromium/src/+/main/docs/security/apparmor-userns-restrictions.md

Signed-off-by: deadprogram <ron@hybridgroup.com>
This commit is contained in:
deadprogram
2025-02-12 14:08:05 +01:00
committed by Ron Evans
parent f24cd31895
commit d04eea7185
+9 -1
View File
@@ -33,8 +33,16 @@ func runargs(t *testing.T, args ...string) error {
}
func chromectx(t *testing.T) context.Context {
// see https://chromium.googlesource.com/chromium/src/+/main/docs/security/apparmor-userns-restrictions.md
opts := append(chromedp.DefaultExecAllocatorOptions[:],
chromedp.NoSandbox,
)
allocCtx, cancel := chromedp.NewExecAllocator(context.Background(), opts...)
t.Cleanup(cancel)
// looks for locally installed Chrome
ctx, ccancel := chromedp.NewContext(context.Background(), chromedp.WithErrorf(t.Errorf), chromedp.WithDebugf(t.Logf), chromedp.WithLogf(t.Logf))
ctx, ccancel := chromedp.NewContext(allocCtx, chromedp.WithErrorf(t.Errorf), chromedp.WithDebugf(t.Logf), chromedp.WithLogf(t.Logf))
t.Cleanup(ccancel)
// Wait for browser to be ready.