Skip to content

Commit 8d94b34

Browse files
committed
[rb] Use no-sandbox on non-Windows
This is required on RBE which runs Docker linux
1 parent f54ba8b commit 8d94b34

File tree

2 files changed

+8
-0
lines changed

2 files changed

+8
-0
lines changed

rb/spec/integration/selenium/webdriver/spec_support/test_environment.rb

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -250,13 +250,15 @@ def safari_preview_driver(**opts)
250250
def chrome_options(args: [], **opts)
251251
opts[:binary] ||= ENV['CHROME_BINARY'] if ENV.key?('CHROME_BINARY')
252252
args << '--headless=chrome' if ENV['HEADLESS']
253+
args << '--no-sandbox' if ENV['NO_SANDBOX']
253254
args << '--disable-gpu'
254255
WebDriver::Options.chrome(browser_version: 'stable', args: args, **opts)
255256
end
256257

257258
def edge_options(args: [], **opts)
258259
opts[:binary] ||= ENV['EDGE_BINARY'] if ENV.key?('EDGE_BINARY')
259260
args << '--headless=chrome' if ENV['HEADLESS']
261+
args << '--no-sandbox' if ENV['NO_SANDBOX']
260262
args << '--disable-gpu'
261263
WebDriver::Options.edge(browser_version: 'stable', args: args, **opts)
262264
end

rb/spec/tests.bzl

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,9 @@ BROWSERS = {
3030
}) | select({
3131
"@selenium//common:use_headless_browser": {"HEADLESS": "true"},
3232
"//conditions:default": {},
33+
}) | select({
34+
"@platforms//os:windows": {},
35+
"//conditions:default": {"NO_SANDBOX": "true"},
3336
}),
3437
},
3538
"edge": {
@@ -53,6 +56,9 @@ BROWSERS = {
5356
}) | select({
5457
"@selenium//common:use_headless_browser": {"HEADLESS": "true"},
5558
"//conditions:default": {},
59+
}) | select({
60+
"@platforms//os:windows": {},
61+
"//conditions:default": {"NO_SANDBOX": "true"},
5662
}),
5763
},
5864
"firefox": {

0 commit comments

Comments
 (0)