Add the option to run UI tests with the parallel frontend#153801
Add the option to run UI tests with the parallel frontend#153801ywxt wants to merge 2 commits intorust-lang:mainfrom
Conversation
This comment has been minimized.
This comment has been minimized.
|
This may be a bit silly, but to avoid many unnecessary changes in stderr files you could put the |
|
What exactly failures are ignored by Right now |
failures would produce different errors so that |
tests/ui/async-await/mutually-recursive-async-impl-trait-type.rs
Outdated
Show resolved
Hide resolved
actual: The difference is from alloc ids. Should we mask all of them? |
|
It may be possible to normalize them instead of ignoring. |
67ebcd0 to
414d715
Compare
| @@ -1,5 +1,5 @@ | |||
| //@ dont-require-annotations: NOTE | |||
|
|
|||
| //@ ignore-parallel-frontend different alloc ids | |||
There was a problem hiding this comment.
I will add normalization rules if it's confirmed.
| //@ stderr-per-bitwidth | ||
| //@ dont-require-annotations: NOTE | ||
|
|
||
| //@ ignore-parallel-frontend different alloc ids |
There was a problem hiding this comment.
Although some consts tests didn't get failed in my environment, I marked them as ignored due to alloc ids in stderr.
| //@ compile-flags: --force-warn unused_mut | ||
| //@ check-pass | ||
|
|
||
| //@ ignore-parallel-frontend the message `requested on the ...` appears in different lines |
There was a problem hiding this comment.
The message is reported on two different source lines. Maybe we can solve it by comparison approaches?
| //@ compile-flags: -Z query-dep-graph | ||
|
|
||
| //@ ignore-parallel-frontend dep graph | ||
| #![feature(rustc_attrs)] |
There was a problem hiding this comment.
The dep graph tests failed on some rustc_then_this_would_need attributes.
Do you know the detail? @zetanumbers @Zoxc
There was a problem hiding this comment.
I was able to reproduce a failure on main. It seems to be non-deterministic. Perhaps #152621 helps. I haven't looked into the issues with -Z query-dep-graph.
|
|
||
| The parallel frontend is avaliable in UI tests only at the moment, and is not currently supported in other test suites. | ||
|
|
||
| If you run with `--parallel-frontend-threads` and `--bless`, then `--parallel-frontend-threads` will be valied. |
There was a problem hiding this comment.
What does this sentence mean? :) I didn't understand it due to the last word probably being typoed.
There was a problem hiding this comment.
yea, this is a typo. :)
There was a problem hiding this comment.
I still wouldn't understand what "would be invalid" means, tbh 😅 Let's say something like this:
If you run with both `--parallel-frontend-threads` and `--bless`, then `--parallel-frontend-threads` would be ignored, to ensure that the blessed output is deterministic.
|
@rustbot ready |
| /// Note that the parallel frontend is disabled when `bless` is true, | ||
| /// to avoid swapping errors it can cause in snapshot updates. | ||
| pub fn parallel_frontend_enabled(&self) -> bool { | ||
| !self.bless && self.parallel_frontend_threads != 1 |
There was a problem hiding this comment.
I don't think --bless and --parallel-frontend-threads should affect each other in any way.
Blessing is not used on CI, locally you can either not use blessing when running parallel frontend, or actually use it for debugging the differences in diagnostics order.
There was a problem hiding this comment.
One possibility is to bless without parallel, then bless with parallel, to minimise the number of differences committed to git due to line re-ordering.
Context and longer discussion here:
#153797 (comment)
There was a problem hiding this comment.
Or we may make a panic when both --bless and --parallel-frontend-threads passed?
There was a problem hiding this comment.
Or we may make a panic when both
--blessand--parallel-frontend-threadspassed?
Why? Blessing in parallel mode is a useful functionality, even if the results are never committed.
|
Some changes occurred in src/tools/compiletest cc @jieyouxu The rustc-dev-guide subtree was changed. If this PR only touches the dev guide consider submitting a PR directly to rust-lang/rustc-dev-guide otherwise thank you for updating the dev guide with your changes. |
|
Just as I've said before in #t-compiler/parallel-rustc > Add the parallel front-end test suite @ 💬, I would like to see individual parallel rustc tests to be done sequentially. This way each rustc process would utilize CPU cores without much of context switching and as I believe reaching better parallel front-end coverage. |
|
r=me after removing the bless condition from All the possible improvements like #153801 (comment) and #153801 (comment) can be done once the general support is merged and the tests start running on CI. |
some new failures under the parallel frontend due to the new note |
This PR adds two arguments for tests:
--parallel-frontend-threads: specify-Zthreadto compile test case (currently UI tests only)--iteration-count: the number of times to run each testAlso, due to the non-deterministic diagnostic orders and cycle errors, this PR adds the directive
//@ ignore-parallel-frontendto ignore tests with cycle error when the parallel-frontend is enabled (by--parallel-frontend-threads) and enables//@ compare-output-by-linesby default.Context: #t-compiler/parallel-rustc > Add the parallel front-end test suite @ 💬
This PR should work with #153797 together.