Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve code for rustdoc-gui tester #91584

Merged
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions src/tools/rustdoc-gui/tester.js
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,7 @@ async function main(argv) {
// Print successful tests too
let debug = false;
// Run tests in sequentially
let no_headless = false;
let headless = true;
const options = new Options();
try {
// This is more convenient that setting fields one by one.
Expand All @@ -150,7 +150,7 @@ async function main(argv) {
}
if (opts["no_headless"]) {
args.push("--no-headless");
no_headless = true;
headless = false;
}
options.parseArguments(args);
} catch (error) {
Expand All @@ -172,7 +172,7 @@ async function main(argv) {
}
files.sort();

if (no_headless) {
if (!headless) {
opts["jobs"] = 1;
console.log("`--no-headless` option is active, disabling concurrency for running tests.");
}
Expand All @@ -181,7 +181,7 @@ async function main(argv) {

if (opts["jobs"] < 1) {
process.setMaxListeners(files.length + 1);
} else if (!no_headless) {
} else if (headless) {
process.setMaxListeners(opts["jobs"] + 1);
}

Expand Down Expand Up @@ -226,7 +226,7 @@ async function main(argv) {
await Promise.race(tests_queue);
}
}
if (!no_headless && tests_queue.length > 0) {
if (tests_queue.length > 0) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Was this check intentionally removed? This seems like a potential behavior change.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It is in theory impossible because we run them one by one when we have the --no-headless option. But that seems like a redundant check so I just removed it. If there is a remaining test, well, it'll be run here.

await Promise.all(tests_queue);
}
status_bar.finish();
Expand Down