Sha256: 2f48626eb0a4135d480aa5bf72e514c4abf39aa17711c96d3829f93c03758557

Contents?: true

Size: 792 Bytes

Versions: 70

Compression:

Stored size: 792 Bytes

Contents

use crate::runtime::{Builder, Handle};

#[test]
fn join_handle_cancel_on_shutdown() {
    let mut builder = loom::model::Builder::new();
    builder.preemption_bound = Some(2);
    builder.check(|| {
        use futures::future::FutureExt;

        let rt = Builder::new_multi_thread()
            .worker_threads(2)
            .build()
            .unwrap();

        let handle = rt.block_on(async move { Handle::current() });

        let jh1 = handle.spawn(futures::future::pending::<()>());

        drop(rt);

        let jh2 = handle.spawn(futures::future::pending::<()>());

        let err1 = jh1.now_or_never().unwrap().unwrap_err();
        let err2 = jh2.now_or_never().unwrap().unwrap_err();
        assert!(err1.is_cancelled());
        assert!(err2.is_cancelled());
    });
}

Version data entries

70 entries across 39 versions & 1 rubygems

Version Path
wasmtime-30.0.2 ./ext/cargo-vendor/tokio-1.43.0/src/runtime/tests/loom_multi_thread_alt/shutdown.rs
wasmtime-30.0.2 ./ext/cargo-vendor/tokio-1.43.0/src/runtime/tests/loom_multi_thread/shutdown.rs
wasmtime-29.0.0 ./ext/cargo-vendor/tokio-1.43.0/src/runtime/tests/loom_multi_thread/shutdown.rs
wasmtime-29.0.0 ./ext/cargo-vendor/tokio-1.43.0/src/runtime/tests/loom_multi_thread_alt/shutdown.rs
wasmtime-28.0.0 ./ext/cargo-vendor/tokio-1.43.0/src/runtime/tests/loom_multi_thread/shutdown.rs
wasmtime-28.0.0 ./ext/cargo-vendor/tokio-1.43.0/src/runtime/tests/loom_multi_thread_alt/shutdown.rs
wasmtime-27.0.0 ./ext/cargo-vendor/tokio-1.41.1/src/runtime/tests/loom_multi_thread/shutdown.rs
wasmtime-27.0.0 ./ext/cargo-vendor/tokio-1.41.1/src/runtime/tests/loom_multi_thread_alt/shutdown.rs
wasmtime-26.0.0 ./ext/cargo-vendor/tokio-1.41.0/src/runtime/tests/loom_multi_thread_alt/shutdown.rs
wasmtime-26.0.0 ./ext/cargo-vendor/tokio-1.41.0/src/runtime/tests/loom_multi_thread/shutdown.rs
wasmtime-25.0.2 ./ext/cargo-vendor/tokio-1.40.0/src/runtime/tests/loom_multi_thread_alt/shutdown.rs
wasmtime-25.0.2 ./ext/cargo-vendor/tokio-1.40.0/src/runtime/tests/loom_multi_thread/shutdown.rs
wasmtime-25.0.1 ./ext/cargo-vendor/tokio-1.39.3/src/runtime/tests/loom_multi_thread/shutdown.rs
wasmtime-25.0.1 ./ext/cargo-vendor/tokio-1.39.3/src/runtime/tests/loom_multi_thread_alt/shutdown.rs
wasmtime-25.0.0 ./ext/cargo-vendor/tokio-1.39.3/src/runtime/tests/loom_multi_thread/shutdown.rs
wasmtime-25.0.0 ./ext/cargo-vendor/tokio-1.39.3/src/runtime/tests/loom_multi_thread_alt/shutdown.rs
wasmtime-24.0.0 ./ext/cargo-vendor/tokio-1.39.3/src/runtime/tests/loom_multi_thread/shutdown.rs
wasmtime-24.0.0 ./ext/cargo-vendor/tokio-1.39.3/src/runtime/tests/loom_multi_thread_alt/shutdown.rs
wasmtime-23.0.2 ./ext/cargo-vendor/tokio-1.36.0/src/runtime/tests/loom_multi_thread_alt/shutdown.rs
wasmtime-23.0.2 ./ext/cargo-vendor/tokio-1.36.0/src/runtime/tests/loom_multi_thread/shutdown.rs