-
-
Notifications
You must be signed in to change notification settings - Fork 2.5k
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
Add more test to be tested with miri in CI #6885
Conversation
Currently all tests passed except for https://github.com/tokio-rs/tokio/actions/runs/11220730350/job/31189595252?pr=6885, seems like a toolchain installation problem? |
I'll try rerunning that particular check. |
Yup |
.github/workflows/ci.yml
Outdated
working-directory: tokio | ||
env: | ||
MIRIFLAGS: -Zmiri-disable-isolation -Zmiri-strict-provenance -Zmiri-retag-fields | ||
MIRIFLAGS: -Zmiri-disable-isolation -Zmiri-strict-provenance -Zmiri-retag-fields -Zmiri-tree-borrows |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I also added tree-borrows check because I ran the test suite with it, if this is not desired I can remove them.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That is fine. We may want to consider whether it makes sense to run with both?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If both means tree borrows and stacked borrows, I think -Zmiri-tree-borrows
will replace stacked borrows with tree borrows rule. On second thought, since tree borrows seems to be more experimental, let me remove this and keep it to stacked borrow.
The CI logs said EDIT: Yup I saw
|
Sure, feel free to change the miri version. |
.github/workflows/ci.yml
Outdated
rustup toolchain install nightly-2024-09-19 --component miri --profile minimal --no-self-update | ||
rustup override set nightly | ||
cargo miri test --features full --lib --tests --no-fail-fast |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I am trying to keep the change minimal, so I don't really want to change env.rust_nightly
, but I am not sure if this will work.
EDIT: This won't work
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We'll probably want to get them back in sync as a follow-up PR, then.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do you mean rust_miri_nightly
and rust_nightly
?
As expected, with the amount of new tests tested with miri, it slows down the CI significantly. It goes from 1 minute to 37 minutes. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Overal looks good. It would be nice to know why tests are disabled - I see you commented the reason on only a few of them.
tokio/tests/rt_handle_block_on.rs
Outdated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This both disables miri for the entire file and for specific tests.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Right, thanks for catching this.
// Blocked on https://github.com/rust-lang/miri/issues/3911 | ||
#![cfg(not(miri))] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Was this fixed?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, but I don't think the latest fix is synced to rustc yet.
.github/workflows/ci.yml
Outdated
working-directory: tokio | ||
env: | ||
MIRIFLAGS: -Zmiri-disable-isolation -Zmiri-strict-provenance -Zmiri-retag-fields | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Deleting this line seems like a spurious change.
I checked the error messages, most of them are either too slow, or having unsupported error. I also filed issues for other errors. If you don't mind, I can annotate them in future PRs. I planned to collect and count all the unsupported error, so I can do this together too. Besides, I am thinking of bumping the miri nightly version again in future to include all the fixes. So it might be better to keep |
- name: Install cargo-nextest | ||
uses: taiki-e/install-action@v2 | ||
with: | ||
tool: cargo-nextest |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nextest
decreased miri running time roughly from 37 minutes to 21 minutes.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That's nice. The loom jobs are already much longer than that. We could consider gating it similarly to what we did for loom tests.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This seems reasonable. We can merge it as-is if you think it is ready. We can always continue to improve it in follow-up PRs, e.g. for bumping miri versions and such.
Yup, this PR is ready. I added the tasks that should be done in future PR in #6812, so we might want to keep the issue open until they are resolved. Thanks for the review and mentoring! |
Motivation
Open up more test to be tested in Miri as mentioned in #6812
Solution