Make normalization in a test case resilient to dist compilation#158318
Make normalization in a test case resilient to dist compilation#158318steffahn wants to merge 1 commit into
Conversation
The new normalization regex is taken from many existing test cases, see: https://github.com/search?q=repo%3Arust-lang%2Frust+%2Fthread+%27rustc%27%5C.%5C*panicked%2F&type=code which includes files such as `tests/ui/treat-err-as-bug/span_delayed_bug.rs` or `tests/ui/treat-err-as-bug/err.rs`
|
r? @camelid rustbot has assigned @camelid. Use Why was this reviewer chosen?The reviewer was selected based on:
|
|
To clarify: This doesn't make it so that In before this, the test run on my machine - in a setup reproducing #158219 - did end in output like
|
There was a problem hiding this comment.
Seems good, but I think it might be better to leave the original issue open since we should add an error in bootstrap itself for this situation like you suggested in #158219 (comment). Also, I'm a little perplexed why our tests aren't resilient to being run in dist mode in the first place. It seems like something that we should support.
|
|
||
|
|
||
|
|
||
| aborting due to `-Z treat-err-as-bug=1` |
There was a problem hiding this comment.
Any idea why this disappeared? Is it some kind of compiletest magic that wasn't working properly before?
There was a problem hiding this comment.
Just the two extra new lines at the end of the regex.
There was a problem hiding this comment.
I.e. the new normalize-stderr regex ends in .*:\n.*\n removing the extra line (which in general is the panic message or something like that, I think). Among the search results I had already linked above, only half do it that way though.
//@ normalize-stderr: "thread 'rustc'.*panicked.*:\n.*\n" -> ""The other commonly-used one would have left the aborting due to … line.
//@ normalize-stderr: "thread 'rustc'.*panicked.*\n" -> ""There was a problem hiding this comment.
To be completely honest I had the exact same thought initially, too. "some kind of compiletest magic" seemed plausible. I needed to test things out more times both ways one more time make sure that it works the same in the dist or non-dist branch/folder I had open… and took probably 5+ minutes before realizing that these \ns in the regex are what's doing it.
There was a problem hiding this comment.
Ahh that makes sense, thank you.
|
I unlinked the issue |
I'm okay with our stuff failing in someone else's CI, honestly, though that might be mostly just reaction to the frequency of "we patched the compiler, but now it doesn't work" coming up. But the accumulated reason it failed has gone from "huh? there's nothing here?" (my mistake) through "well you do have to explicitly invoke this test" all the way to "...how does that even matter?" and... I'd rather it fail consistently or not, yes. |
I also believe this would be the best result. That's why I'm happy to either leave #158219 open as @camelid suggested, or open a follow-up issue that's more explicitly opened about that general goal, rather starting with a user reporting an “ICE”. Anyway, this PR still seems a good first step since the As for “fail consistently” - I’m not familiar with the details of what |
There was a problem hiding this comment.
Thanks! Agreed that this is a good fix for now, but that we should also make testing in dist mode behave in a more consistent way that doesn't lead to confusing errors. I'm fine with either reusing the existing issue or making a new one, so I'll leave it to you.
|
|
||
|
|
||
|
|
||
| aborting due to `-Z treat-err-as-bug=1` |
There was a problem hiding this comment.
Ahh that makes sense, thank you.
|
@bors r+ rollup |
Make normalization in a test case resilient to dist compilation This fixes rust-lang#158219 by adapting the `tests/rustdoc-ui/ice-bug-report-url` test case such that it will no longer fail with the remapping prefixes from rust-lang#150110 This was previously sometimes the first test failure if someone tried `x.py test` on a compiler checkout configured with `dist` setup, prominently featuring the new (mismatching) test `stdout` containing the scary ICE error message. --- The new normalization regex is taken from many existing test cases, see: [↝ this code search ⮺](https://github.com/search?q=repo%3Arust-lang%2Frust+%2Fthread+%27rustc%27%5C.%5C*panicked%2F&type=code) which includes files such as [`tests/ui/treat-err-as-bug/span_delayed_bug.rs`](https://github.com/rust-lang/rust/blob/4429659e4745016bd3f26a4a421843edc7fbc422/tests/ui/treat-err-as-bug/span_delayed_bug.rs#L4) or [`tests/ui/treat-err-as-bug/err.rs`](https://github.com/rust-lang/rust/blob/4429659e4745016bd3f26a4a421843edc7fbc422/tests/ui/treat-err-as-bug/err.rs#L4).
I’ve opened a new one and re-linked this PR to fix the issue it aims to fix ^^ |
Make normalization in a test case resilient to dist compilation This fixes rust-lang#158219 by adapting the `tests/rustdoc-ui/ice-bug-report-url` test case such that it will no longer fail with the remapping prefixes from rust-lang#150110 This was previously sometimes the first test failure if someone tried `x.py test` on a compiler checkout configured with `dist` setup, prominently featuring the new (mismatching) test `stdout` containing the scary ICE error message. --- The new normalization regex is taken from many existing test cases, see: [↝ this code search ⮺](https://github.com/search?q=repo%3Arust-lang%2Frust+%2Fthread+%27rustc%27%5C.%5C*panicked%2F&type=code) which includes files such as [`tests/ui/treat-err-as-bug/span_delayed_bug.rs`](https://github.com/rust-lang/rust/blob/4429659e4745016bd3f26a4a421843edc7fbc422/tests/ui/treat-err-as-bug/span_delayed_bug.rs#L4) or [`tests/ui/treat-err-as-bug/err.rs`](https://github.com/rust-lang/rust/blob/4429659e4745016bd3f26a4a421843edc7fbc422/tests/ui/treat-err-as-bug/err.rs#L4).
Make normalization in a test case resilient to dist compilation This fixes rust-lang#158219 by adapting the `tests/rustdoc-ui/ice-bug-report-url` test case such that it will no longer fail with the remapping prefixes from rust-lang#150110 This was previously sometimes the first test failure if someone tried `x.py test` on a compiler checkout configured with `dist` setup, prominently featuring the new (mismatching) test `stdout` containing the scary ICE error message. --- The new normalization regex is taken from many existing test cases, see: [↝ this code search ⮺](https://github.com/search?q=repo%3Arust-lang%2Frust+%2Fthread+%27rustc%27%5C.%5C*panicked%2F&type=code) which includes files such as [`tests/ui/treat-err-as-bug/span_delayed_bug.rs`](https://github.com/rust-lang/rust/blob/4429659e4745016bd3f26a4a421843edc7fbc422/tests/ui/treat-err-as-bug/span_delayed_bug.rs#L4) or [`tests/ui/treat-err-as-bug/err.rs`](https://github.com/rust-lang/rust/blob/4429659e4745016bd3f26a4a421843edc7fbc422/tests/ui/treat-err-as-bug/err.rs#L4).
…uwer Rollup of 17 pull requests Successful merges: - #153697 (Add arg splat experiment initial tuple impl) - #158294 (Use .drectve for MSVC DLL exports) - #158253 (codegen_ssa: multiply scalable vec size by `vscale`) - #158308 (Fix bug when rustdoc "go to only result" setting is not working as expected") - #158345 (Use `transmute_neo` in `assume_init`) - #158369 (std: abort when `resume_unwind` is called inside the panic hook) - #158374 (disallow tail calling extern "rust-call" functions) - #158380 (Revert "rebuild LLVM when `bootstrap.toml` config changes") - #154398 (Add test for async Send with PhantomData<*mut ()> + unsafe impl Send + dyn Trait) - #157181 (autodiff: stop always needing an alloca) - #158278 (autodiff - typtree cleanups) - #158311 (doc(unstable-book): fix typo "earier" -> "earlier" in default-visibility flag) - #158318 (Make normalization in a test case resilient to dist compilation) - #158338 (Reorganize `tests/ui/issues` [14/N]) - #158343 (Include `Item::const_stability` info in rustdoc JSON.) - #158355 (Fixup the refactoring errors in #156246) - #158390 (Fix: auto trait, const trait bound) Failed merges: - #155535 (export symbols: support macos/windows(32/64))
Make normalization in a test case resilient to dist compilation This fixes rust-lang#158219 by adapting the `tests/rustdoc-ui/ice-bug-report-url` test case such that it will no longer fail with the remapping prefixes from rust-lang#150110 This was previously sometimes the first test failure if someone tried `x.py test` on a compiler checkout configured with `dist` setup, prominently featuring the new (mismatching) test `stdout` containing the scary ICE error message. --- The new normalization regex is taken from many existing test cases, see: [↝ this code search ⮺](https://github.com/search?q=repo%3Arust-lang%2Frust+%2Fthread+%27rustc%27%5C.%5C*panicked%2F&type=code) which includes files such as [`tests/ui/treat-err-as-bug/span_delayed_bug.rs`](https://github.com/rust-lang/rust/blob/4429659e4745016bd3f26a4a421843edc7fbc422/tests/ui/treat-err-as-bug/span_delayed_bug.rs#L4) or [`tests/ui/treat-err-as-bug/err.rs`](https://github.com/rust-lang/rust/blob/4429659e4745016bd3f26a4a421843edc7fbc422/tests/ui/treat-err-as-bug/err.rs#L4).
…uwer Rollup of 17 pull requests Successful merges: - #153697 (Add arg splat experiment initial tuple impl) - #155535 (export symbols: support macos/windows(32/64)) - #158253 (codegen_ssa: multiply scalable vec size by `vscale`) - #158308 (Fix bug when rustdoc "go to only result" setting is not working as expected") - #158345 (Use `transmute_neo` in `assume_init`) - #158369 (std: abort when `resume_unwind` is called inside the panic hook) - #158374 (disallow tail calling extern "rust-call" functions) - #158380 (Revert "rebuild LLVM when `bootstrap.toml` config changes") - #154398 (Add test for async Send with PhantomData<*mut ()> + unsafe impl Send + dyn Trait) - #157181 (autodiff: stop always needing an alloca) - #158278 (autodiff - typtree cleanups) - #158311 (doc(unstable-book): fix typo "earier" -> "earlier" in default-visibility flag) - #158318 (Make normalization in a test case resilient to dist compilation) - #158338 (Reorganize `tests/ui/issues` [14/N]) - #158343 (Include `Item::const_stability` info in rustdoc JSON.) - #158355 (Fixup the refactoring errors in #156246) - #158390 (Fix: auto trait, const trait bound)
…uwer Rollup of 17 pull requests Successful merges: - #153697 (Add arg splat experiment initial tuple impl) - #155535 (export symbols: support macos/windows(32/64)) - #158253 (codegen_ssa: multiply scalable vec size by `vscale`) - #158308 (Fix bug when rustdoc "go to only result" setting is not working as expected") - #158345 (Use `transmute_neo` in `assume_init`) - #158369 (std: abort when `resume_unwind` is called inside the panic hook) - #158374 (disallow tail calling extern "rust-call" functions) - #158380 (Revert "rebuild LLVM when `bootstrap.toml` config changes") - #154398 (Add test for async Send with PhantomData<*mut ()> + unsafe impl Send + dyn Trait) - #157181 (autodiff: stop always needing an alloca) - #158278 (autodiff - typtree cleanups) - #158311 (doc(unstable-book): fix typo "earier" -> "earlier" in default-visibility flag) - #158318 (Make normalization in a test case resilient to dist compilation) - #158338 (Reorganize `tests/ui/issues` [14/N]) - #158343 (Include `Item::const_stability` info in rustdoc JSON.) - #158355 (Fixup the refactoring errors in #156246) - #158390 (Fix: auto trait, const trait bound)
…uwer Rollup of 17 pull requests Successful merges: - #153697 (Add arg splat experiment initial tuple impl) - #155535 (export symbols: support macos/windows(32/64)) - #158253 (codegen_ssa: multiply scalable vec size by `vscale`) - #158308 (Fix bug when rustdoc "go to only result" setting is not working as expected") - #158345 (Use `transmute_neo` in `assume_init`) - #158369 (std: abort when `resume_unwind` is called inside the panic hook) - #158374 (disallow tail calling extern "rust-call" functions) - #158380 (Revert "rebuild LLVM when `bootstrap.toml` config changes") - #154398 (Add test for async Send with PhantomData<*mut ()> + unsafe impl Send + dyn Trait) - #157181 (autodiff: stop always needing an alloca) - #158278 (autodiff - typtree cleanups) - #158311 (doc(unstable-book): fix typo "earier" -> "earlier" in default-visibility flag) - #158318 (Make normalization in a test case resilient to dist compilation) - #158338 (Reorganize `tests/ui/issues` [14/N]) - #158343 (Include `Item::const_stability` info in rustdoc JSON.) - #158355 (Fixup the refactoring errors in #156246) - #158390 (Fix: auto trait, const trait bound)
This fixes #158219 by adapting the
tests/rustdoc-ui/ice-bug-report-urltest case such that it will no longer fail with the remapping prefixes from #150110This was previously sometimes the first test failure if someone tried
x.py teston a compiler checkout configured withdistsetup, prominently featuring the new (mismatching) teststdoutcontaining the scary ICE error message.The new normalization regex is taken from many existing test cases,
see: ↝ this code search ⮺
which includes files such as
tests/ui/treat-err-as-bug/span_delayed_bug.rsortests/ui/treat-err-as-bug/err.rs.