-
-
Notifications
You must be signed in to change notification settings - Fork 2.8k
tokio-util: enable loom testing for cancellation token #7644
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
base: master
Are you sure you want to change the base?
Changes from all commits
959ba27
24187f9
2b27516
1981e52
3bdecd2
361b3fc
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change | ||||||||||||||||||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
@@ -95,3 +95,19 @@ jobs: | |||||||||||||||||||||||||||||||||||||||||||||||||
working-directory: tokio | ||||||||||||||||||||||||||||||||||||||||||||||||||
env: | ||||||||||||||||||||||||||||||||||||||||||||||||||
SCOPE: ${{ matrix.scope }} | ||||||||||||||||||||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||||||||||||||||||||
loom-util-sync: | ||||||||||||||||||||||||||||||||||||||||||||||||||
name: loom tokio-util::sync | ||||||||||||||||||||||||||||||||||||||||||||||||||
# base_ref is null when it's not a pull request | ||||||||||||||||||||||||||||||||||||||||||||||||||
if: github.repository_owner == 'tokio-rs' && (contains(github.event.pull_request.labels.*.name, 'R-loom-util-sync') || (github.base_ref == null)) | ||||||||||||||||||||||||||||||||||||||||||||||||||
Comment on lines
+100
to
+102
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
Since there is no many loom tests in |
||||||||||||||||||||||||||||||||||||||||||||||||||
runs-on: ubuntu-latest | ||||||||||||||||||||||||||||||||||||||||||||||||||
steps: | ||||||||||||||||||||||||||||||||||||||||||||||||||
- uses: actions/checkout@v5 | ||||||||||||||||||||||||||||||||||||||||||||||||||
- name: Install Rust ${{ env.rust_stable }} | ||||||||||||||||||||||||||||||||||||||||||||||||||
uses: dtolnay/rust-toolchain@master | ||||||||||||||||||||||||||||||||||||||||||||||||||
with: | ||||||||||||||||||||||||||||||||||||||||||||||||||
toolchain: ${{ env.rust_stable }} | ||||||||||||||||||||||||||||||||||||||||||||||||||
- uses: Swatinem/rust-cache@v2 | ||||||||||||||||||||||||||||||||||||||||||||||||||
- name: run tests | ||||||||||||||||||||||||||||||||||||||||||||||||||
run: cargo test --lib --release --features full -- --nocapture sync::tests | ||||||||||||||||||||||||||||||||||||||||||||||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
tokio/tokio-util/src/either.rs Lines 215 to 236 in 9255d96
It should be ok to exclude these tests from loom, and then run all unit tests using loom. |
||||||||||||||||||||||||||||||||||||||||||||||||||
working-directory: tokio-util |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,9 @@ | ||
pub(crate) use std::sync; | ||
//! This module abstracts over `loom` and `std::sync` types depending on whether we | ||
//! are running loom tests or not. | ||
|
||
pub(crate) mod sync { | ||
#[cfg(all(test, loom))] | ||
pub(crate) use loom::sync::{Arc, Mutex, MutexGuard}; | ||
#[cfg(not(all(test, loom)))] | ||
pub(crate) use std::sync::{Arc, Mutex, MutexGuard}; | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,5 @@ | ||
#![cfg(not(loom))] | ||
|
||
//! TCP/UDP/Unix helpers for tokio. | ||
|
||
use crate::either::Either; | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,2 @@ | ||
|
||
#[cfg(loom)] | ||
mod loom_cancellation_token; |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,5 @@ | ||
#![cfg(not(loom))] | ||
|
||
//! UDP framing | ||
|
||
mod frame; | ||
|
Uh oh!
There was an error while loading. Please reload this page.
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.
See #7644 (comment).