From 2cb0f68a7bc0d2aa5eebee936346084f178dc864 Mon Sep 17 00:00:00 2001 From: Wei Huang Date: Mon, 16 Jul 2018 12:10:11 -0400 Subject: [PATCH] test(bazel): allow no sandbox for protractor tests (#24906) It specifies --no-sandbox flag when running the protractor tests as root. This is needed for running the tests inside a docker container. PR Close #24906 --- packages/bazel/src/protractor/protractor.conf.js | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/packages/bazel/src/protractor/protractor.conf.js b/packages/bazel/src/protractor/protractor.conf.js index 70ee78a475..dae9bb3c8d 100644 --- a/packages/bazel/src/protractor/protractor.conf.js +++ b/packages/bazel/src/protractor/protractor.conf.js @@ -107,6 +107,11 @@ if (process.env['WEB_TEST_METADATA']) { if (headless) { args.push('--headless'); args.push('--disable-gpu'); + const isRoot = process.getuid && process.getuid() == 0; + if (isRoot) { + // Specify --no-sandbox if it is started by root. + args.push('--no-sandbox'); + } } setConf(conf, 'directConnect', true, 'is set to true for chrome'); setConf(