Skip to content

Commit d04eea7

Browse files
committed
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>
1 parent f24cd31 commit d04eea7

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

tests/wasm/setup_test.go

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,8 +33,16 @@ func runargs(t *testing.T, args ...string) error {
3333
}
3434

3535
func chromectx(t *testing.T) context.Context {
36+
// see https://chromium.googlesource.com/chromium/src/+/main/docs/security/apparmor-userns-restrictions.md
37+
opts := append(chromedp.DefaultExecAllocatorOptions[:],
38+
chromedp.NoSandbox,
39+
)
40+
41+
allocCtx, cancel := chromedp.NewExecAllocator(context.Background(), opts...)
42+
t.Cleanup(cancel)
43+
3644
// looks for locally installed Chrome
37-
ctx, ccancel := chromedp.NewContext(context.Background(), chromedp.WithErrorf(t.Errorf), chromedp.WithDebugf(t.Logf), chromedp.WithLogf(t.Logf))
45+
ctx, ccancel := chromedp.NewContext(allocCtx, chromedp.WithErrorf(t.Errorf), chromedp.WithDebugf(t.Logf), chromedp.WithLogf(t.Logf))
3846
t.Cleanup(ccancel)
3947

4048
// Wait for browser to be ready.

0 commit comments

Comments
 (0)