Closed xieyuschen closed 1 month ago
I don't have the permission to assign reviewers, @elfenpiff @elBoberido
@xieyuschen Your CI run is failing because of a flaky test on our side, it is fixed with #422 When this PR is merged you can rebase and this should fix the problem.
@xieyuschen Your CI run is failing because of a flaky test on our side, it is fixed with #422 When this PR is merged you can rebase and this should fix the problem.
sure, could I please ask if it’s possible to merge #423 today? Thank you!"
I just checked the "green" Miri job, it isn't running any tests:
Run ./internal/scripts/ci_run_miri.sh
Run cargo miri test under: /home/runner/work/iceoryx2/iceoryx2/iceoryx2-bb/testing
Updating crates.io index
Locking 151 packages to latest compatible versions
Adding bindgen v0.69.[4](https://github.com/eclipse-iceoryx/iceoryx2/actions/runs/11124175590/job/30915883586?pr=421#step:4:5) (available: v0.70.1)
Adding cbindgen v0.26.0 (available: v0.27.0)
Adding human-panic v1.2.3 (available: v2.0.1)
Adding windows-sys v0.48.0 (available: v0.[5](https://github.com/eclipse-iceoryx/iceoryx2/actions/runs/11124175590/job/30915883586?pr=421#step:4:6)9.0)
Compiling iceoryx2-pal-configuration v0.4.1 (/home/runner/work/iceoryx2/iceoryx2/iceoryx2-pal/configuration)
Compiling iceoryx2-bb-testing v0.4.1 (/home/runner/work/iceoryx2/iceoryx2/iceoryx2-bb/testing)
Finished `test` profile [unoptimized + debuginfo] target(s) in 0.[6](https://github.com/eclipse-iceoryx/iceoryx2/actions/runs/11124175590/job/30915883586?pr=421#step:4:7)5s
Running unittests src/lib.rs (/home/runner/work/iceoryx2/iceoryx2/target/miri/x86_64-unknown-linux-gnu/debug/deps/iceoryx2_bb_testing-59d902fc[7](https://github.com/eclipse-iceoryx/iceoryx2/actions/runs/11124175590/job/30915883586?pr=421#step:4:8)96b2132)
running 0 tests
test result: ok. 0 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; finished in 0.03s
Doc-tests iceoryx2_bb_testing
running 0 tests
test result: ok. 0 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; finished in 0.00s
Is that intentional for this initial PR?
I just checked the "green" Miri job, it isn't running any tests:
Run ./internal/scripts/ci_run_miri.sh Run cargo miri test under: /home/runner/work/iceoryx2/iceoryx2/iceoryx2-bb/testing Updating crates.io index Locking 151 packages to latest compatible versions Adding bindgen v0.69.[4](https://github.com/eclipse-iceoryx/iceoryx2/actions/runs/11124175590/job/30915883586?pr=421#step:4:5) (available: v0.70.1) Adding cbindgen v0.26.0 (available: v0.27.0) Adding human-panic v1.2.3 (available: v2.0.1) Adding windows-sys v0.48.0 (available: v0.[5](https://github.com/eclipse-iceoryx/iceoryx2/actions/runs/11124175590/job/30915883586?pr=421#step:4:6)9.0) Compiling iceoryx2-pal-configuration v0.4.1 (/home/runner/work/iceoryx2/iceoryx2/iceoryx2-pal/configuration) Compiling iceoryx2-bb-testing v0.4.1 (/home/runner/work/iceoryx2/iceoryx2/iceoryx2-bb/testing) Finished `test` profile [unoptimized + debuginfo] target(s) in 0.[6](https://github.com/eclipse-iceoryx/iceoryx2/actions/runs/11124175590/job/30915883586?pr=421#step:4:7)5s Running unittests src/lib.rs (/home/runner/work/iceoryx2/iceoryx2/target/miri/x86_64-unknown-linux-gnu/debug/deps/iceoryx2_bb_testing-59d902fc[7](https://github.com/eclipse-iceoryx/iceoryx2/actions/runs/11124175590/job/30915883586?pr=421#step:4:8)96b2132) running 0 tests test result: ok. 0 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; finished in 0.03s Doc-tests iceoryx2_bb_testing running 0 tests test result: ok. 0 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; finished in 0.00s
Is that intentional for this initial PR?
Is that intentional for this initial PR?
I think so, the miri output looks confusing. Here I have some examples to show you:
mkdir demo && cd $_ && cargo init && cargo miri test
: the same output(test result: ok. 0 passed; ...)
Running miri
under a cargo init
project without any error should be the expected behavior.
cd iceoryx2-bb/testing && cargo miri test
: the same output
cd iceoryx2-bb/memory && cargo miri test
: you will see some errors.
I think so, the miri output looks confusing. Here I have some examples to show you:
mkdir demo && cd $_ && cargo init && cargo miri test
: the same output(test result: ok. 0 passed; ...) Runningmiri
under acargo init
project without any error should be the expected behavior.cd iceoryx2-bb/testing && cargo miri test
: the same outputcd iceoryx2-bb/memory && cargo miri test
: you will see some errors.
@xieyuschen
From cargo miri --help
:
Runs binary crates and tests in Miri
Usage:
cargo miri [subcommand] [<cargo options>...] [--] [<program/test suite options>...]
Subcommands:
run, r Run binaries
test, t Run tests
nextest Run tests with nextest (requires cargo-nextest installed)
setup Only perform automatic setup, but without asking questions (for getting a proper libstd)
clean Clean the Miri cache & target directory
So the command cargo miri test
, as in your script, runs Miri for the tests defined in the crate. Perhaps misleading, but iceoryx2-bb/testing
does not define any tests - this crate includes helpers for testing.
The crate iceoryx2-bb/memory
does define tests, hence the output showing errors (we haven't spent any time looking into Miri violations yet).
Fixing all Miri findings in the project will be an arduous task. I think it's OK to limit the scope of this PR to setting up the infrastructure for running Miri in CI.
However, it has occurred to me that running Miri on all crates defined in the 'allow list' might not be the best approach. It would make the check take longer than needed if unrelated crates are checked in every PR.
Limiting the check to the crates added or modified in the PR seems a better approach. So the check would run if crateOnAllowList && crateAddedOrModified
.
The allow list would still be necessary so that we are not blocked from adding new features while the work to address Miri violations for every crate is not yet done.
So how to move forward? My proposal is as follows, feel free to share your perspective:
iceoryx2-bb
)This would give us a good foundation for:
@elfenpiff @elBoberido Thoughts?
Limiting the check to the crates added or modified in the PR seems a better approach
This approach sounds nice, but I think it has a shortage: The new PR should focus on its own goal, but involving miri fix requires the reviewers take more times to review the changes. If the miri error fixes are put in a separated PR, the PR is short and easy-to-win.
This workflow might be better:
cargo miri test
to find some errorsIt's more fluent for developers to add features. The problem here is that if you never start the step1, it's hard to fix miri errors incrementally.
All modified and coverable lines are covered by tests :white_check_mark:
Project coverage is 79.00%. Comparing base (
6d25b61
) to head (b04b534
). Report is 4 commits behind head on main.
Limiting the check to the crates added or modified in the PR seems a better approach
This approach sounds nice, but I think it has a shortage: The new PR should focus on its own goal, but involving miri fix requires the reviewers take more times to review the changes. If the miri error fixes are put in a separated PR, the PR is short and easy-to-win.
This workflow might be better:
- have short time which is not enough for big change
- run
cargo miri test
to find some errors- fix it and create an easy-to-win PR, add it in the allowlist
It's more fluent for developers to add features. The problem here is that if you never start the step1, it's hard to fix miri errors incrementally.
@xieyuschen
Fine to skip the fixing a Miri violation in this PR - I had suggested it as a mechanism to verify the job behaviour before and changes to a crate we pushed. Could be done in a follow-up with the first fix, though.
I would still suggest to tweak the job so that it runs on crates changed in the given PR.
You could do this by checking if the changed-files have a path prefix matching an entry in the .miri_allowlist
(other ideas welcome). In the absence of an actual change in a crate, you can use logs to verify the logic is functioning as expected.
@orecham done, can see https://github.com/xieyuschen/iceoryx2/pull/3 for ref.
@orecham done, can see his testPR](xieyuschen#3) for ref.
@xieyuschen Amazing ! Thanks for the contribution :)
Allow CI failures for now
Notes for Reviewer
I have integrated miri in github action while supporting a shell-style
.miri_allowlist
file for all sub-folders to runcargo miri test
.Pre-Review Checklist for the PR Author
SPDX-License-Identifier: Apache-2.0 OR MIT
iox2-123-introduce-posix-ipc-example
)[#123] Add posix ipc example
)task-list-completed
)Checklist for the PR Reviewer
Unit tests have been written for new behaviorPublic API is documentedPost-review Checklist for the PR Author
References
Relates #60