|
@ -192,7 +192,7 @@ mod test { |
|
|
use crate::args;
|
|
|
use crate::args;
|
|
|
use crate::async_utils::run;
|
|
|
use crate::async_utils::run;
|
|
|
use crate::command_runner::{CommandRunner, StdCommandRunner};
|
|
|
use crate::command_runner::{CommandRunner, StdCommandRunner};
|
|
|
use futures::future::FutureExt;
|
|
|
|
|
|
|
|
|
use futures_util::future::FutureExt;
|
|
|
use std::time::Instant;
|
|
|
use std::time::Instant;
|
|
|
|
|
|
|
|
|
#[test]
|
|
|
#[test]
|
|
@ -203,9 +203,9 @@ mod test { |
|
|
let start = Instant::now();
|
|
|
let start = Instant::now();
|
|
|
let res = c.run("sleep", args, "").fuse();
|
|
|
let res = c.run("sleep", args, "").fuse();
|
|
|
let ps = c.run("ps", args![], "").fuse();
|
|
|
let ps = c.run("ps", args![], "").fuse();
|
|
|
futures::pin_mut!(res, ps);
|
|
|
|
|
|
|
|
|
futures_util::pin_mut!(res, ps);
|
|
|
loop {
|
|
|
loop {
|
|
|
futures::select! {
|
|
|
|
|
|
|
|
|
futures_util::select! {
|
|
|
_ = res => {},
|
|
|
_ = res => {},
|
|
|
_ = ps => assert!((Instant::now() - start).as_millis() < 1000),
|
|
|
_ = ps => assert!((Instant::now() - start).as_millis() < 1000),
|
|
|
complete => break,
|
|
|
complete => break,
|
|
|