Skip to content

Commit 670c180

Browse files
committed
Wait for 10ms to be sure b is created after a
1 parent 6e4bfcb commit 670c180

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

tests/by-util/test_ls.rs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
use crate::common::util::*;
22
extern crate regex;
33
use self::regex::Regex;
4+
use std::{thread, time};
45

56
#[test]
67
fn test_ls_ls() {
@@ -91,6 +92,9 @@ fn test_ls_ls_tc() {
9192

9293
at.mkdir(dir);
9394
at.touch(file_a);
95+
// Wait for 10ms to be sure b is created after a
96+
let ten_millis = time::Duration::from_millis(10);
97+
thread::sleep(ten_millis);
9498
at.touch(file_b);
9599

96100
let result = new_ucmd!().arg(at.plus(dir)).run();

0 commit comments

Comments
 (0)