Make bootstrap self test parallel by Shourya742 · Pull Request #146155 · rust-lang/rust (original) (raw)

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 andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Conversation11 Commits3 Checks10 Files changed

Conversation

This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.Learn more about bidirectional Unicode characters

[ Show hidden characters]({{ revealButtonHref }})

@Shourya742

This PR refactors the bootstrap self test:

  1. Replaced the hardcoded --test-threads=1 with std::thread::available_parallelism(), allowing tests to run with the maximum concurrency supported by the system.
  2. Replaced custom hacks around OUT_DIR with TempDir and introduced TestCtx to simplify configuration setup.

r? @Kobzol

@Shourya742

@Shourya742

Use std::thread::available_parallelism() instead of hardcoded --test-threads=1 in bootstrap tests.

@rustbot rustbot added A-testsuite

Area: The testsuite used to check the correctness of rustc

S-waiting-on-review

Status: Awaiting review from the assignee but also interested parties.

T-bootstrap

Relevant to the bootstrap subteam: Rust's build system (x.py and src/bootstrap)

labels

Sep 3, 2025

Kobzol

@Kobzol Kobzol left a comment • Loading

Choose a reason for hiding this comment

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

@Kobzol

Eventually it would be great to get rid of all usages of Config::parse from tests, except for the one in TestCtx.

@Shourya742

@Kobzol

Thanks! You can r=me once CI is green.

@bors delegate+

@bors

✌️ @Shourya742, you can now approve this pull request!

If @Kobzol told you to "r=me" after making some further change, please make that change, then do @bors r=@Kobzol

@Shourya742

@bors

📌 Commit 9f3fe40 has been approved by Kobzol

It is now in the queue for this repository.

@bors bors added S-waiting-on-bors

Status: Waiting on bors to run and complete tests. Bors will change the label on completion.

and removed S-waiting-on-review

Status: Awaiting review from the assignee but also interested parties.

labels

Sep 3, 2025

klensy

Comment on lines -3297 to -3298

// bootstrap tests are racy on directory creation so just run them one at a time.
// Since there's not many this shouldn't be a problem.

Choose a reason for hiding this comment

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

This implies that tests no longer racy?

Choose a reason for hiding this comment

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

We have attempted to remove all racy tests. If we find any more on CI, we should fix them, rather than making the test execution serial.

bors added a commit that referenced this pull request

Sep 4, 2025

@bors

Rollup of 24 pull requests

Successful merges:

r? @ghost @rustbot modify labels: rollup

rust-timer added a commit that referenced this pull request

Sep 4, 2025

@rust-timer

Rollup merge of #146155 - Shourya742:2025-09-03-make-test-run-parallel, r=Kobzol

Make bootstrap self test parallel

This PR refactors the bootstrap self test:

  1. Replaced the hardcoded --test-threads=1 with std::thread::available_parallelism(), allowing tests to run with the maximum concurrency supported by the system.
  2. Replaced custom hacks around OUT_DIR with TempDir and introduced TestCtx to simplify configuration setup.

r? @Kobzol

github-actions bot pushed a commit to rust-lang/miri that referenced this pull request

Sep 5, 2025

@bors

github-actions bot pushed a commit to rust-lang/rustc-dev-guide that referenced this pull request

Sep 8, 2025

@bors

github-actions bot pushed a commit to model-checking/verify-rust-std that referenced this pull request

Sep 9, 2025

@bors

Labels

A-testsuite

Area: The testsuite used to check the correctness of rustc

S-waiting-on-bors

Status: Waiting on bors to run and complete tests. Bors will change the label on completion.

T-bootstrap

Relevant to the bootstrap subteam: Rust's build system (x.py and src/bootstrap)