Skip to content

Commit

Permalink
Create a threashhold timeout for tests on CI
Browse files Browse the repository at this point in the history
  • Loading branch information
zhiburt committed Sep 6, 2021
1 parent 6d43698 commit 98fdd26
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 6 deletions.
1 change: 1 addition & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ jobs:
steps:
- uses: actions/checkout@v2
- uses: actions-rs/cargo@v1
timeout-minutes: 3
with:
command: test
args: --verbose --no-fail-fast
Expand Down
2 changes: 1 addition & 1 deletion tests/expect.rs
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ fn expect_str() {
#[cfg(windows)]
#[test]
fn expect_str() {
let mut session = spawn("powershell -C type").unwrap();
let mut session = spawn("pwsh -C type").unwrap();

// give shell some time
std::thread::sleep(Duration::from_millis(300));
Expand Down
6 changes: 1 addition & 5 deletions tests/io.rs
Original file line number Diff line number Diff line change
Expand Up @@ -159,7 +159,7 @@ fn try_read_by_byte() {
Session::spawn(ProcAttr::default().commandline("powershell".to_string())).unwrap();
_p_send_line(
&mut proc,
"while (1) { read-host | set r; if (!$r) { break }}",
"while (1) { read-host | set r; echo $r; if (!$r) { break }}",
)
.unwrap();
_p_read_until(&mut proc, b'}').unwrap();
Expand All @@ -180,10 +180,6 @@ fn try_read_by_byte() {
assert_eq!(&buf, &[b'\r']);
_p_try_read(&mut proc, &mut buf).unwrap();
assert_eq!(&buf, &[b'\n']);
assert_eq!(
_p_try_read(&mut proc, &mut buf).unwrap_err().kind(),
std::io::ErrorKind::WouldBlock
);
}

#[test]
Expand Down

0 comments on commit 98fdd26

Please sign in to comment.