Skip to content

test: add cross-runtime integration test harness - #229

Draft
jiengup wants to merge 1 commit into
apache:mainfrom
jiengup:test-suite
Draft

test: add cross-runtime integration test harness#229
jiengup wants to merge 1 commit into
apache:mainfrom
jiengup:test-suite

Conversation

@jiengup

@jiengup jiengup commented Aug 27, 2026

Copy link
Copy Markdown
Contributor

Summary

Related to #154

  • Add a cross-runtime integration test harness for Tokio, Smol, and Compio.
  • Introduce the #[runtime_test] procedural macro with runtime and capability filtering.
  • Migrate mutex and semaphore integration tests away from Tokio-specific APIs.
  • Add coverage for worker-task and thread-local task behavior.

Design Notes

The #[runtime_test] macro expands each annotated async function into an ordinary test for every matching runtime and injects a statically bound runtime alias 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. The only(...) and require(...) 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_permits API to validate permit reduction and pending acquisition behavior consistently across all three runtimes.

Testing

  • cargo +1.86.0 x test --no-capture
  • cargo x test --no-capture
  • cargo x check
  • cargo x lint

All commands completed successfully.

Introduce a runtime_test macro and runtime helpers so tests run on
tokio, compio, and smol instead of only tokio.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant