test: add cross-runtime integration test harness - #229
Draft
jiengup wants to merge 1 commit into
Draft
Conversation
Introduce a runtime_test macro and runtime helpers so tests run on tokio, compio, and smol instead of only tokio.
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Summary
Related to #154
#[runtime_test]procedural macro with runtime and capability filtering.Design Notes
The
#[runtime_test]macro expands each annotated async function into an ordinary test for every matching runtime and injects a statically boundruntimealias into the test body. A shared runtime abstraction normalizes task spawning, thread-local execution, detached tasks, join errors, yielding, sleeping, and timeouts while preserving each executor’s scheduling model. Theonly(...)andrequire(...)arguments allow tests to target individual runtimes or declare required capabilities without introducing runtime-specific logic into the test itself.Existing mutex and semaphore tests now use these normalized operations, with deterministic yielding replacing executor-specific timing where possible. Compio is constrained to the latest release series compatible with Rust 1.86, and its join behavior is adapted to the common harness interface. The semaphore coverage also uses the existing
reduce_permitsAPI to validate permit reduction and pending acquisition behavior consistently across all three runtimes.Testing
cargo +1.86.0 x test --no-capturecargo x test --no-capturecargo x checkcargo x lintAll commands completed successfully.