diff --git a/core/src/server/distant/handler.rs b/core/src/server/distant/handler.rs index 8e4a9f9f..d03ac0a0 100644 --- a/core/src/server/distant/handler.rs +++ b/core/src/server/distant/handler.rs @@ -2089,13 +2089,12 @@ mod tests { ); } + // NOTE: Ignoring on windows because it's using WSL which wants a Linux path + // with / but thinks it's on windows and is providing \ #[tokio::test] + #[cfg_attr(windows, ignore)] async fn proc_run_should_send_back_stdout_periodically_when_available() { let (conn_id, state, tx, mut rx) = setup(1); - println!( - "ECHO_ARGS_TO_STDOUT_SH: {:?}", - ECHO_ARGS_TO_STDOUT_SH.to_str() - ); // Run a program that echoes to stdout let req = Request::new( @@ -2155,7 +2154,10 @@ mod tests { assert!(got_done, "Missing done response"); } + // NOTE: Ignoring on windows because it's using WSL which wants a Linux path + // with / but thinks it's on windows and is providing \ #[tokio::test] + #[cfg_attr(windows, ignore)] async fn proc_run_should_send_back_stderr_periodically_when_available() { let (conn_id, state, tx, mut rx) = setup(1); @@ -2217,7 +2219,10 @@ mod tests { assert!(got_done, "Missing done response"); } + // NOTE: Ignoring on windows because it's using WSL which wants a Linux path + // with / but thinks it's on windows and is providing \ #[tokio::test] + #[cfg_attr(windows, ignore)] async fn proc_run_should_clear_process_from_state_when_done() { let (conn_id, state, tx, mut rx) = setup(1); @@ -2425,7 +2430,10 @@ mod tests { ); } + // NOTE: Ignoring on windows because it's using WSL which wants a Linux path + // with / but thinks it's on windows and is providing \ #[tokio::test] + #[cfg_attr(windows, ignore)] async fn proc_stdin_should_send_ok_on_success_and_properly_send_stdin_to_process() { let (conn_id, state, tx, mut rx) = setup(1); diff --git a/core/src/server/utils.rs b/core/src/server/utils.rs index 89615dd3..76fcc19d 100644 --- a/core/src/server/utils.rs +++ b/core/src/server/utils.rs @@ -164,12 +164,12 @@ mod tests { "Shutdown task unexpectedly completed" ); - time::sleep(Duration::from_millis(50)).await; - - assert!( - futures::poll!(task).is_ready(), - "Shutdown task unexpectedly pending" - ); + tokio::select! { + _ = task => {} + _ = time::sleep(Duration::from_secs(1)) => { + panic!("Shutdown task unexpectedly pending"); + } + } } #[tokio::test] @@ -189,12 +189,13 @@ mod tests { ); task.tracker().lock().await.decrement(); - time::sleep(Duration::from_millis(50)).await; - assert!( - futures::poll!(task).is_ready(), - "Shutdown task unexpectedly pending" - ); + tokio::select! { + _ = task => {} + _ = time::sleep(Duration::from_secs(1)) => { + panic!("Shutdown task unexpectedly pending"); + } + } } #[tokio::test]