Skip to content

Commit 06a473f

Browse files
committed
tests/fold: kill child process before making asserts
1 parent 2b4fbd9 commit 06a473f

1 file changed

Lines changed: 8 additions & 5 deletions

File tree

tests/by-util/test_fold.rs

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -894,11 +894,14 @@ fn test_bytewise_carriage_return_is_not_word_boundary() {
894894
fn test_bytewise_read_from_pseudo_device() {
895895
let mut child = new_ucmd!().arg("-b").arg("/dev/zero").run_no_wait();
896896

897-
let timeout = std::time::Duration::from_millis(100);
898-
std::thread::sleep(timeout);
899-
child.close_stdin();
900-
assert!(child.stdout_all().contains("\x00\x0a"));
901-
assert!(child.stderr_all().is_empty());
897+
child.make_assertion_with_delay(100).is_alive();
898+
899+
child
900+
.kill()
901+
.make_assertion()
902+
.with_all_output()
903+
.stdout_contains_bytes(b"\x00\x0a")
904+
.no_stderr();
902905
}
903906

904907
#[test]

0 commit comments

Comments
 (0)