Sha256: d86bc121eb85e96497f546be6f85dc6804a852b71e0237998a77f5dd9be2acf7

Contents?: true

Size: 857 Bytes

Versions: 2

Compression:

Stored size: 857 Bytes

Contents

#![warn(rust_2018_idioms)]
#![cfg(feature = "full")]
#![cfg(any(
    target_os = "dragonfly",
    target_os = "freebsd",
    target_os = "macos",
    target_os = "netbsd",
    target_os = "openbsd",
    target_os = "illumos"
))]
#![cfg(not(miri))] // No `sigaction` on Miri

mod support {
    pub mod signal;
}
use support::signal::send_signal;

use tokio::signal;
use tokio::signal::unix::SignalKind;
use tokio::time::{timeout, Duration};

#[tokio::test]
async fn siginfo() {
    let mut sig = signal::unix::signal(SignalKind::info()).expect("installed signal handler");

    tokio::spawn(async {
        send_signal(libc::SIGINFO);
    });

    // Add a timeout to ensure the test doesn't hang.
    timeout(Duration::from_secs(5), sig.recv())
        .await
        .expect("received SIGINFO signal in time")
        .expect("received SIGINFO signal");
}

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
wasmtime-29.0.0 ./ext/cargo-vendor/tokio-1.43.0/tests/signal_info.rs
wasmtime-28.0.0 ./ext/cargo-vendor/tokio-1.43.0/tests/signal_info.rs