mirror of
https://github.com/tokio-rs/tokio.git
synced 2026-09-07 00:00:08 +02:00
util: enable loom tests (#7644)
Co-authored-by: Benjamin Ran <[email protected]>
This commit is contained in:
co-authored by
Benjamin Ran
parent
0671c205cc
commit
d84a9e9af3
@@ -212,7 +212,7 @@ where
|
||||
}
|
||||
}
|
||||
|
||||
#[cfg(test)]
|
||||
#[cfg(all(test, not(loom)))]
|
||||
mod tests {
|
||||
use super::*;
|
||||
use tokio::io::{repeat, AsyncReadExt, Repeat};
|
||||
|
||||
@@ -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};
|
||||
}
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
#![cfg(not(loom))]
|
||||
|
||||
//! TCP/UDP/Unix helpers for tokio.
|
||||
|
||||
use crate::either::Either;
|
||||
|
||||
@@ -15,3 +15,6 @@ pub use poll_semaphore::PollSemaphore;
|
||||
|
||||
mod reusable_box;
|
||||
pub use reusable_box::ReusableBoxFuture;
|
||||
|
||||
#[cfg(test)]
|
||||
mod tests;
|
||||
|
||||
@@ -100,6 +100,9 @@ fn drop_token_no_child() {
|
||||
});
|
||||
}
|
||||
|
||||
// Temporarily disabled due to a false positive in loom -
|
||||
// see https://github.com/tokio-rs/tokio/pull/7644#issuecomment-3328381344
|
||||
#[ignore]
|
||||
#[test]
|
||||
fn drop_token_with_children() {
|
||||
loom::model(|| {
|
||||
@@ -125,6 +128,9 @@ fn drop_token_with_children() {
|
||||
});
|
||||
}
|
||||
|
||||
// Temporarily disabled due to a false positive in loom -
|
||||
// see https://github.com/tokio-rs/tokio/pull/7644#issuecomment-3328381344
|
||||
#[ignore]
|
||||
#[test]
|
||||
fn drop_and_cancel_token() {
|
||||
loom::model(|| {
|
||||
@@ -150,6 +156,9 @@ fn drop_and_cancel_token() {
|
||||
});
|
||||
}
|
||||
|
||||
// Temporarily disabled due to a false positive in loom -
|
||||
// see https://github.com/tokio-rs/tokio/pull/7644#issuecomment-3328381344
|
||||
#[ignore]
|
||||
#[test]
|
||||
fn cancel_parent_and_child() {
|
||||
loom::model(|| {
|
||||
|
||||
@@ -1 +1,2 @@
|
||||
|
||||
#[cfg(loom)]
|
||||
mod loom_cancellation_token;
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
#![cfg(not(loom))]
|
||||
|
||||
//! UDP framing
|
||||
|
||||
mod frame;
|
||||
|
||||
Reference in New Issue
Block a user