Skip to content

Commit 11b1b4f

Browse files
Rollup merge of #131230 - GuillaumeGomez:no-sandbox, r=notriddle
Enable `--no-sandbox` option by default for rustdoc GUI tests It's apparently common enough for people to have issues with the `sandbox` mode in chromium, so better disable it by default. r? `@notriddle`
2 parents ba94a2a + 32099db commit 11b1b4f

File tree

3 files changed

+2
-33
lines changed

3 files changed

+2
-33
lines changed

src/ci/docker/host-x86_64/x86_64-gnu-tools/Dockerfile

+1-1
Original file line numberDiff line numberDiff line change
@@ -100,4 +100,4 @@ RUN /scripts/build-gccjit.sh /scripts
100100
# the local version of the package is different than the one used by the CI.
101101
ENV SCRIPT /tmp/checktools.sh ../x.py && \
102102
npm install browser-ui-test@$(head -n 1 /tmp/browser-ui-test.version) --unsafe-perm=true && \
103-
python3 ../x.py test tests/rustdoc-gui --stage 2 --test-args "'--no-sandbox --jobs 1'"
103+
python3 ../x.py test tests/rustdoc-gui --stage 2 --test-args "'--jobs 1'"

src/tools/rustdoc-gui/tester.js

+1-25
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,6 @@ function showHelp() {
1919
console.log(" --debug : show extra information about script run");
2020
console.log(" --show-text : render font in pages");
2121
console.log(" --no-headless : disable headless mode");
22-
console.log(" --no-sandbox : disable sandbox mode");
2322
console.log(" --help : show this message then quit");
2423
console.log(" --tests-folder [PATH] : location of the .GOML tests folder");
2524
console.log(" --jobs [NUMBER] : number of threads to run tests on");
@@ -40,7 +39,6 @@ function parseOptions(args) {
4039
"no_headless": false,
4140
"jobs": -1,
4241
"executable_path": null,
43-
"no_sandbox": false,
4442
};
4543
const correspondences = {
4644
"--doc-folder": "doc_folder",
@@ -49,7 +47,6 @@ function parseOptions(args) {
4947
"--show-text": "show_text",
5048
"--no-headless": "no_headless",
5149
"--executable-path": "executable_path",
52-
"--no-sandbox": "no_sandbox",
5350
};
5451

5552
for (let i = 0; i < args.length; ++i) {
@@ -80,9 +77,6 @@ function parseOptions(args) {
8077
} else if (arg === "--help") {
8178
showHelp();
8279
process.exit(0);
83-
} else if (arg === "--no-sandbox") {
84-
console.log("`--no-sandbox` is being used. Be very careful!");
85-
opts[correspondences[arg]] = true;
8680
} else if (correspondences[arg]) {
8781
opts[correspondences[arg]] = true;
8882
} else {
@@ -203,6 +197,7 @@ async function main(argv) {
203197
const args = [
204198
"--variable", "DOC_PATH", opts["doc_folder"].split("\\").join("/"),
205199
"--enable-fail-on-js-error", "--allow-file-access-from-files",
200+
"--no-sandbox",
206201
];
207202
if (opts["debug"]) {
208203
debug = true;
@@ -211,9 +206,6 @@ async function main(argv) {
211206
if (opts["show_text"]) {
212207
args.push("--show-text");
213208
}
214-
if (opts["no_sandbox"]) {
215-
args.push("--no-sandbox");
216-
}
217209
if (opts["no_headless"]) {
218210
args.push("--no-headless");
219211
headless = false;
@@ -262,19 +254,6 @@ async function main(argv) {
262254
console.log(`Running ${files.length} rustdoc-gui ...`);
263255
}
264256

265-
// We catch this "event" to display a nicer message in case of unexpected exit (because of a
266-
// missing `--no-sandbox`).
267-
const exitHandling = () => {
268-
if (!opts["no_sandbox"]) {
269-
console.log("");
270-
console.log(
271-
"`browser-ui-test` crashed unexpectedly. Please try again with adding `--test-args \
272-
--no-sandbox` at the end. For example: `x.py test tests/rustdoc-gui --test-args --no-sandbox`");
273-
console.log("");
274-
}
275-
};
276-
process.on("exit", exitHandling);
277-
278257
const originalFilesLen = files.length;
279258
const results = createEmptyResults();
280259
const status_bar = char_printer(files.length);
@@ -299,9 +278,6 @@ async function main(argv) {
299278
Array.prototype.push.apply(results.failed, new_results.failed);
300279
Array.prototype.push.apply(results.errored, new_results.errored);
301280

302-
// We don't need this listener anymore.
303-
process.removeListener("exit", exitHandling);
304-
305281
if (debug) {
306282
results.successful.sort(by_filename);
307283
results.successful.forEach(r => {

tests/rustdoc-gui/README.md

-7
Original file line numberDiff line numberDiff line change
@@ -23,12 +23,5 @@ $ ./x.py test tests/rustdoc-gui --stage 1 --test-args --no-headless
2323

2424
To see the supported options, use `--help`.
2525

26-
Important to be noted: if the chromium instance crashes when you run it, you might need to
27-
use `--no-sandbox` to make it work:
28-
29-
```bash
30-
$ ./x.py test tests/rustdoc-gui --stage 1 --test-args --no-sandbox
31-
```
32-
3326
[browser-ui-test]: https://github.com/GuillaumeGomez/browser-UI-test/
3427
[puppeteer]: https://pptr.dev/

0 commit comments

Comments
 (0)