From 8d90142a0fadd29652b4bb14ea7c08141101f56f Mon Sep 17 00:00:00 2001 From: Kristiyan Kostadinov Date: Wed, 6 Feb 2019 10:48:23 +0100 Subject: [PATCH] build: disable sandbox when running protractor through bazel (#28557) Adds `--no-sandbox` in order to disable the sandbox when running Protractor through Bazel. Enabling the sandbox causes Chrome to crash under certain environments. PR Close #28557 --- packages/bazel/src/protractor/protractor.conf.js | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/packages/bazel/src/protractor/protractor.conf.js b/packages/bazel/src/protractor/protractor.conf.js index bea852a056..3eaef57197 100644 --- a/packages/bazel/src/protractor/protractor.conf.js +++ b/packages/bazel/src/protractor/protractor.conf.js @@ -129,10 +129,12 @@ if (process.env['WEB_TEST_METADATA']) { if (webTestNamedFiles['CHROMIUM']) { const chromeBin = require.resolve(webTestNamedFiles['CHROMIUM']); const chromeDriver = require.resolve(webTestNamedFiles['CHROMEDRIVER']); - const args = []; + + // The sandbox needs to be disabled, because it causes Chrome to crash on some environments. + // See: http://chromedriver.chromium.org/help/chrome-doesn-t-start + const args = ['--no-sandbox']; if (headless) { - args.push('--headless'); - args.push('--disable-gpu'); + args.push('--headless', '--disable-gpu'); } setConf(conf, 'directConnect', true, 'is set to true for chrome'); setConf(conf, 'chromeDriver', chromeDriver, 'is determined by the browsers attribute');