Skip to content

Commit 2cb0f68

Browse files
huangw5vicb
authored andcommitted
test(bazel): allow no sandbox for protractor tests (angular#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 angular#24906
1 parent 8450e0a commit 2cb0f68

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

packages/bazel/src/protractor/protractor.conf.js

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -107,6 +107,11 @@ if (process.env['WEB_TEST_METADATA']) {
107107
if (headless) {
108108
args.push('--headless');
109109
args.push('--disable-gpu');
110+
const isRoot = process.getuid && process.getuid() == 0;
111+
if (isRoot) {
112+
// Specify --no-sandbox if it is started by root.
113+
args.push('--no-sandbox');
114+
}
110115
}
111116
setConf(conf, 'directConnect', true, 'is set to true for chrome');
112117
setConf(

0 commit comments

Comments
 (0)