Skip to content

Commit

Permalink
tests: Decrease the various sleeps
Browse files Browse the repository at this point in the history
  • Loading branch information
sylvestre committed Jan 27, 2025
1 parent dfd5885 commit f00a8c2
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion tests/by-util/test_cp.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2907,7 +2907,7 @@ fn test_copy_through_dangling_symlink_no_dereference_permissions() {
// target name link name
at.symlink_file("no-such-file", "dangle");
// to check if access time and modification time didn't change
sleep(Duration::from_millis(5000));
sleep(Duration::from_millis(100));
// don't dereference the link
// | copy permissions, too
// | | from the link
Expand Down
4 changes: 2 additions & 2 deletions tests/by-util/test_install.rs
Original file line number Diff line number Diff line change
Expand Up @@ -577,7 +577,7 @@ fn test_install_copy_then_compare_file_with_extra_mode() {

let mut file2_meta = at.metadata(file2);
let before = FileTime::from_last_modification_time(&file2_meta);
sleep(std::time::Duration::from_millis(1000));
sleep(std::time::Duration::from_millis(100));

scene
.ucmd()
Expand All @@ -594,7 +594,7 @@ fn test_install_copy_then_compare_file_with_extra_mode() {

assert!(before != after_install_sticky);

sleep(std::time::Duration::from_millis(1000));
sleep(std::time::Duration::from_millis(100));

// dest file still 1644, so need_copy ought to return `true`
scene
Expand Down
4 changes: 2 additions & 2 deletions tests/by-util/test_test.rs
Original file line number Diff line number Diff line change
Expand Up @@ -381,7 +381,7 @@ fn test_newer_file() {
let scenario = TestScenario::new(util_name!());

scenario.fixtures.touch("regular_file");
sleep(std::time::Duration::from_millis(1000));
sleep(std::time::Duration::from_millis(100));
scenario.fixtures.touch("newer_file");

scenario
Expand Down Expand Up @@ -949,7 +949,7 @@ fn test_file_N() {
scene.ucmd().args(&["-N", "regular_file"]).fails();
// The file will have different create/modified data
// so, test -N will return 0
sleep(std::time::Duration::from_millis(1000));
sleep(std::time::Duration::from_millis(100));
at.touch("regular_file");
scene.ucmd().args(&["-N", "regular_file"]).succeeds();
}
Expand Down

0 comments on commit f00a8c2

Please sign in to comment.