-
Notifications
You must be signed in to change notification settings - Fork 26
feat(hiroz): debug-time barrier against callbacks under a lock #255
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
Open
YuanYuYuan
wants to merge
7
commits into
main
Choose a base branch
from
pr/1-reentrancy-tripwire
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
7 commits
Select commit
Hold shift + click to select a range
a42824f
feat(hiroz): debug-time barrier against callbacks under a lock
YuanYuYuan 0bd010a
fix(reentrancy): make GuardCount unforgeable, widen the local rustdoc…
YuanYuYuan dd615e0
fix(tests): enforce the feature requirement package-wide
YuanYuYuan 8a8651a
fix(ci): lint hiroz-tests with its features, satisfy pre-commit rustfmt
YuanYuYuan 10b1b58
fix(ci): keep rmw-zenoh-rs out of the ROS-independent test run
YuanYuYuan 69326f0
fix(ci): skip the SHM-size suite in the ROS-independent test run
YuanYuYuan a70f733
fix(reentrancy): stop citing a defect as the exemplar, drop invented …
YuanYuYuan File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,58 @@ | ||
| //! Fails loudly when `hiroz-tests` is built without the features its suites need. | ||
| //! | ||
| //! Ten suites in this crate are `#![cfg(feature = "ros-msgs")]` — `cache.rs`, | ||
| //! `lifecycle.rs`, `parameter_tests.rs`, `service_schema_discovery.rs`, | ||
| //! `subscriber_timeout.rs`, `type_description_integration.rs`, the `z_*_example` | ||
| //! suites, and others. A crate-level `cfg` that is not satisfied does not error | ||
| //! and does not warn: the file compiles to an empty test binary reporting | ||
| //! `0 passed`, which is indistinguishable from green in every runner and log. | ||
| //! | ||
| //! Two separate mechanisms could hide that, and they are worth keeping distinct: | ||
| //! | ||
| //! * **Selection.** `Cargo.toml` sets | ||
| //! `default-members = ["crates/hiroz", "crates/hiroz-codegen"]`, so a bare | ||
| //! `cargo nextest run` never selected `hiroz-tests` at all — the crate was not | ||
| //! built, rather than built empty. `scripts/test-pure-rust.nu` now names the | ||
| //! crate explicitly. | ||
| //! * **Empty compilation.** Ask for the crate without features and the gated | ||
| //! suites really do compile away to `0 passed`. That is what this file and the | ||
| //! build script guard against. | ||
| //! | ||
| //! This file is deliberately **not** gated, so it is the one thing in the crate | ||
| //! that a featureless build cannot compile away. If the features go missing | ||
| //! again, the run fails with a message naming the cause instead of quietly | ||
| //! shrinking. | ||
| //! | ||
| //! Consequence, stated so it is a decision rather than a surprise: `hiroz-tests` | ||
| //! has no supported featureless configuration. Run it as | ||
| //! `cargo test -p hiroz-tests --features ros-msgs,jazzy` (or with `ros-interop` | ||
| //! for the suites that also need a ROS installation). | ||
|
|
||
| /// Without `ros-msgs`, the gated suites are silently absent — fail instead. | ||
| #[test] | ||
| #[cfg(not(feature = "ros-msgs"))] | ||
| fn ros_msgs_gated_suites_must_not_be_silently_skipped() { | ||
| panic!( | ||
| "hiroz-tests was built without the `ros-msgs` feature.\n\ | ||
| \n\ | ||
| The suites gated on it — `cache.rs`, `lifecycle.rs`, \ | ||
| `parameter_tests.rs` and others — have been \ | ||
| compiled to empty test binaries and will report `0 passed`, which reads \ | ||
| as green. That is not a pass; it is no coverage.\n\ | ||
| \n\ | ||
| Build the crate with its features:\n\ | ||
| \n\ | ||
| cargo test -p hiroz-tests --features ros-msgs,jazzy\n\ | ||
| \n\ | ||
| Suites that additionally drive a real ROS 2 installation need \ | ||
| `--features ros-interop,<distro>` instead." | ||
| ); | ||
| } | ||
|
|
||
| /// With `ros-msgs`, record that the gate was satisfied. | ||
| /// | ||
| /// Present so the guard is visible in the test list in *both* configurations — | ||
| /// a check whose only evidence is the absence of a failure is not a check. | ||
| #[test] | ||
| #[cfg(feature = "ros-msgs")] | ||
| fn ros_msgs_gated_suites_are_compiled_in() {} | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.