mirror of
https://github.com/tokio-rs/tokio.git
synced 2025-10-01 12:20:39 +00:00

* Added timeouts to all tests that were missing them - any issue we have will likely result in deadlocks/starvation so its best if all tests quickly timeout rather than require getting killed or have the CI timeout itself * Added a `support` module and put a bunch of helpers there to DRY the tests
28 lines
691 B
Rust
28 lines
691 B
Rust
#![cfg(unix)]
|
|
|
|
extern crate libc;
|
|
|
|
pub mod support;
|
|
use support::*;
|
|
|
|
#[test]
|
|
fn notify_both() {
|
|
let mut lp = Core::new().unwrap();
|
|
let handle = lp.handle();
|
|
|
|
let signal1 = run_core_with_timeout(&mut lp, Signal::with_handle(
|
|
libc::SIGUSR2,
|
|
&handle.new_tokio_handle(),
|
|
)).expect("failed to create signal1");
|
|
|
|
let signal2 = run_core_with_timeout(&mut lp, Signal::with_handle(
|
|
libc::SIGUSR2,
|
|
&handle.new_tokio_handle(),
|
|
)).expect("failed to create signal2");
|
|
|
|
send_signal(libc::SIGUSR2);
|
|
run_core_with_timeout(&mut lp, signal1.into_future().join(signal2.into_future()))
|
|
.ok()
|
|
.expect("failed to create signal2");
|
|
}
|