Uh oh!
There was an error while loading. Please reload this page.
Record failed tests with --record, and rerun them with --rerun - #154586
Conversation
rustbot
commented
Mar 30, 2026
This PR modifies If appropriate, please update |
rustbot
commented
Mar 30, 2026
r? @clubby789 rustbot has assigned @clubby789. Use Why was this reviewer chosen?The reviewer was selected based on:
|
This comment has been minimized.
This comment has been minimized.
jyn514
commented
Mar 30, 2026
I wouldn't make this configurable. What does |
jdonszelmann
commented
Mar 30, 2026
It will warn, but treat it as if the file was empty.
Keeps it around forever, or at least until you |
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
WaffleLapkin
commented
Mar 30, 2026
If the |
WaffleLapkin
commented
Mar 30, 2026
This is purely a speculation I suppose, but I feel like I will often forget to use |
jyn514
commented
Mar 30, 2026
@WaffleLapkin as long as you don’t modify the compiler, compiletest will remember which tests succeeded the last time, so if you add ––failed it won’t take very long at all to regenerate that list. |
jdonszelmann
commented
Mar 30, 2026
I agree with jyn here, shouldn't make such a big difference |
jdonszelmann
commented
Mar 30, 2026
that is true I think. What do you expect the behavior to be? maybe if no file is found, and no paths are given, exit, but if some paths are explicitly given run the explicit ones? |
jdonszelmann
commented
Mar 30, 2026
with a warning of course |
jyn514
commented
Mar 30, 2026
I think |
jdonszelmann
commented
Mar 30, 2026
mhm, well that's the current behavior. Except the warning of course, that you passed --rerun with nothing to rerun. But I think that's nice |
jdonszelmann
commented
Mar 30, 2026
cc @jieyouxu (you self assigned the other one, that one was in preparation for this one, also I figured out that bug for this one) |
clubby789
commented
Mar 31, 2026
I haven't looked at the full implementation yet, but why not always record failed tests? |
Because a later invocation might only rerun a subset of tests. Say you have this series of invocations: |
clubby789
commented
Mar 31, 2026
Sorry, always *except when using |
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
There was a problem hiding this comment.
Thanks, you can r= clubby and me with one message typo fixed
@rustbot author
| Ok(f) => Some(f), | ||
| Err(e) => { | ||
| println!( | ||
| "Couldn't open file {} to write test failutes to: {e}. (attempted because `--record` was passed). Test failures will not be recorded.", |
jieyouxu
commented
May 19, 2026
I thought about #154586 (comment) a bit more, while the parsing is still a bit hacky, it's not that bad since this is more of convenience feature and not correctness-critical (as in, CI will still catch unaddressed failures even if |
rustbot
commented
Jun 4, 2026
This PR was rebased onto a different main commit. Here's a range-diff highlighting what actually changed. Rebasing is a normal part of keeping PRs up to date, so no action is needed—this note is just to help reviewers. |
jdonszelmann
commented
Jun 4, 2026
@bors r=clubby789,jieyouxu |
…uwer Rollup of 5 pull requests Successful merges: - #154586 (Record failed tests with `--record`, and rerun them with `--rerun`) - #157296 (delegation: split resolution and lowering) - #156171 (Fix a coroutine UI test which is missing `#[coroutine]`) - #157249 (tests: codegen-llvm: Update bpf-alu32 with the new LLVM attributes) - #157426 (rustc-dev-guide subtree update)
Uh oh!
There was an error while loading. Please reload this page.
Rollup merge of #154586 - jdonszelmann:record-rerun, r=clubby789,jieyouxu Record failed tests with `--record`, and rerun them with `--rerun` This adds two parameters to `x test`: ## `--record` Writes a file, by default `build/failed-tests`, but this can be overwritten with ```toml [build] record_failed_tests_path = "somepath" ``` with a list of all tests that fail that run. ## `--rerun` Looks for the failed-tests file, parse it, and attempt to rerun only those tests. No cli-arguments are necessary, i.e. ``` x test tests/ui --record x test --rerun ``` Will run all failed uitests. No need to pass tests/ui to the rerun invocation. The last commit is a little awkward, but I think it's the best way to make it so that we *first* run all tests that have to be rerun, and *then* rerun tests passed through the cli. This makes it so: ``` x test tests/ui --rerun ``` will *first* rerun failed tests, some of which may be uitests, if any fail it quits and reports failed tests, but if all pass it will run all normally passed tests. In other words, only if all previously-failed tests pass on the rerun, we then also run uitests. Without the last commit, this would instead just run all uitests, since the failed tests form a subset of all uitests. I think that's less useful.
…uwer Rollup of 5 pull requests Successful merges: - rust-lang/rust#154586 (Record failed tests with `--record`, and rerun them with `--rerun`) - rust-lang/rust#157296 (delegation: split resolution and lowering) - rust-lang/rust#156171 (Fix a coroutine UI test which is missing `#[coroutine]`) - rust-lang/rust#157249 (tests: codegen-llvm: Update bpf-alu32 with the new LLVM attributes) - rust-lang/rust#157426 (rustc-dev-guide subtree update)
…nathanBrouwer Rollup of 5 pull requests Successful merges: - rust-lang#154586 (Record failed tests with `--record`, and rerun them with `--rerun`) - rust-lang#157296 (delegation: split resolution and lowering) - rust-lang#156171 (Fix a coroutine UI test which is missing `#[coroutine]`) - rust-lang#157249 (tests: codegen-llvm: Update bpf-alu32 with the new LLVM attributes) - rust-lang#157426 (rustc-dev-guide subtree update)
View all comments
This adds two parameters to
x test:--recordWrites a file, by default
build/failed-tests, but this can be overwritten withwith a list of all tests that fail that run.
--rerunLooks for the failed-tests file, parse it, and attempt to rerun only those tests. No cli-arguments are necessary, i.e.
Will run all failed uitests. No need to pass tests/ui to the rerun invocation.
The last commit is a little awkward, but I think it's the best way to make it so that we first run all tests that have to be rerun, and then rerun tests passed through the cli.
This makes it so:
will first rerun failed tests, some of which may be uitests, if any fail it quits and reports failed tests, but if all pass it will run all normally passed tests. In other words, only if all previously-failed tests pass on the rerun, we then also run uitests.
Without the last commit, this would instead just run all uitests, since the failed tests form a subset of all uitests. I think that's less useful.