File tree Expand file tree Collapse file tree 12 files changed +60
-7
lines changed Expand file tree Collapse file tree 12 files changed +60
-7
lines changed Original file line number Diff line number Diff line change @@ -19,3 +19,7 @@ R-loom-multi-thread:
1919- tokio/src/runtime/scheduler/multi_thread/**
2020- tokio/src/runtime/task/*
2121- tokio/src/runtime/task/**
22+
23+ R-loom-util :
24+ - tokio-util/src/*
25+ - tokio-util/src/**/*
Original file line number Diff line number Diff line change 9595 working-directory : tokio
9696 env :
9797 SCOPE : ${{ matrix.scope }}
98+
99+ loom-util :
100+ name : loom tokio-util
101+ # base_ref is null when it's not a pull request
102+ if : github.repository_owner == 'tokio-rs' && (contains(github.event.pull_request.labels.*.name, 'R-loom-util') || (github.base_ref == null))
103+ runs-on : ubuntu-latest
104+ steps :
105+ - uses : actions/checkout@v5
106+ - name : Install Rust ${{ env.rust_stable }}
107+ uses : dtolnay/rust-toolchain@master
108+ with :
109+ toolchain : ${{ env.rust_stable }}
110+ - uses : Swatinem/rust-cache@v2
111+ - name : run tests
112+ run : cargo test --lib --release --features full -- --nocapture
113+ working-directory : tokio-util
Original file line number Diff line number Diff line change @@ -22,9 +22,9 @@ cfg_sync! {
2222}
2323
2424cfg_signal ! {
25- #[ cfg( unix) ]
25+ #[ cfg( all ( unix, not ( loom ) ) ) ]
2626 mod signal_unix;
27- #[ cfg( unix) ]
27+ #[ cfg( all ( unix, not ( loom ) ) ) ]
2828 pub use signal_unix:: SignalStream ;
2929
3030 #[ cfg( any( windows, docsrs) ) ]
@@ -39,12 +39,14 @@ cfg_time! {
3939}
4040
4141cfg_net ! {
42+ #[ cfg( not( loom) ) ]
4243 mod tcp_listener;
44+ #[ cfg( not( loom) ) ]
4345 pub use tcp_listener:: TcpListenerStream ;
4446
45- #[ cfg( unix) ]
47+ #[ cfg( all ( unix, not ( loom ) ) ) ]
4648 mod unix_listener;
47- #[ cfg( unix) ]
49+ #[ cfg( all ( unix, not ( loom ) ) ) ]
4850 pub use unix_listener:: UnixListenerStream ;
4951}
5052
@@ -57,6 +59,8 @@ cfg_io_util! {
5759}
5860
5961cfg_fs ! {
62+ #[ cfg( not( loom) ) ]
6063 mod read_dir;
64+ #[ cfg( not( loom) ) ]
6165 pub use read_dir:: ReadDirStream ;
6266}
Original file line number Diff line number Diff line change @@ -57,6 +57,9 @@ futures-test = "0.3.5"
5757parking_lot = " 0.12.0"
5858tempfile = " 3.1.0"
5959
60+ [target .'cfg(loom)' .dev-dependencies ]
61+ loom = { version = " 0.7" , features = [" futures" , " checkpoint" ] }
62+
6063[package .metadata .docs .rs ]
6164all-features = true
6265# enable unstable features in the documentation
Original file line number Diff line number Diff line change @@ -212,7 +212,7 @@ where
212212 }
213213}
214214
215- #[ cfg( test) ]
215+ #[ cfg( all ( test, not ( loom ) ) ) ]
216216mod tests {
217217 use super :: * ;
218218 use tokio:: io:: { repeat, AsyncReadExt , Repeat } ;
Original file line number Diff line number Diff line change 1- pub ( crate ) use std:: sync;
1+ //! This module abstracts over `loom` and `std::sync` types depending on whether we
2+ //! are running loom tests or not.
3+
4+ pub ( crate ) mod sync {
5+ #[ cfg( all( test, loom) ) ]
6+ pub ( crate ) use loom:: sync:: { Arc , Mutex , MutexGuard } ;
7+ #[ cfg( not( all( test, loom) ) ) ]
8+ pub ( crate ) use std:: sync:: { Arc , Mutex , MutexGuard } ;
9+ }
Original file line number Diff line number Diff line change 1+ #![ cfg( not( loom) ) ]
2+
13//! TCP/UDP/Unix helpers for tokio.
24
35use crate :: either:: Either ;
Original file line number Diff line number Diff line change @@ -15,3 +15,6 @@ pub use poll_semaphore::PollSemaphore;
1515
1616mod reusable_box;
1717pub use reusable_box:: ReusableBoxFuture ;
18+
19+ #[ cfg( test) ]
20+ mod tests;
Original file line number Diff line number Diff line change @@ -100,6 +100,9 @@ fn drop_token_no_child() {
100100 } ) ;
101101}
102102
103+ // Temporarily disabled due to a false positive in loom -
104+ // see https://github.com/tokio-rs/tokio/pull/7644#issuecomment-3328381344
105+ #[ ignore]
103106#[ test]
104107fn drop_token_with_children ( ) {
105108 loom:: model ( || {
@@ -125,6 +128,9 @@ fn drop_token_with_children() {
125128 } ) ;
126129}
127130
131+ // Temporarily disabled due to a false positive in loom -
132+ // see https://github.com/tokio-rs/tokio/pull/7644#issuecomment-3328381344
133+ #[ ignore]
128134#[ test]
129135fn drop_and_cancel_token ( ) {
130136 loom:: model ( || {
@@ -150,6 +156,9 @@ fn drop_and_cancel_token() {
150156 } ) ;
151157}
152158
159+ // Temporarily disabled due to a false positive in loom -
160+ // see https://github.com/tokio-rs/tokio/pull/7644#issuecomment-3328381344
161+ #[ ignore]
153162#[ test]
154163fn cancel_parent_and_child ( ) {
155164 loom:: model ( || {
Original file line number Diff line number Diff line change 1-
1+ #[ cfg( loom) ]
2+ mod loom_cancellation_token;
You can’t perform that action at this time.
0 commit comments