Skip to content

Commit

Permalink
Fix failing CI (#39)
Browse files Browse the repository at this point in the history
* Ignore proc_run tests that are failing due to WSL not using windows path

* Extend time for some shutdown task tests
  • Loading branch information
chipsenkbeil authored Sep 6, 2021
1 parent cf95181 commit c5cbc90
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 15 deletions.
16 changes: 12 additions & 4 deletions core/src/server/distant/handler.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand Down Expand Up @@ -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);

Expand Down Expand Up @@ -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);

Expand Down Expand Up @@ -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);

Expand Down
23 changes: 12 additions & 11 deletions core/src/server/utils.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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]
Expand All @@ -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]
Expand Down

0 comments on commit c5cbc90

Please sign in to comment.